Closed Nbelles closed 4 years ago
Thank you for your order ... lets get these up and running.
Re: TARGET What board are you using or is this a breakout module? Does your ATtiny412 have a decoupling capacitor (usually 0.1µF) installed close to the VCC and GND pins? Make sure the only connections are:
Re: Arduino Nano and Programmer PCB Are you using a Nano clone? Follow the Assembly and Setup procedure here. With the jumpers configured as you've described, you'll notice the programmer's blue HV LED blink once just after power is applied (USB cable connected).
Software: What version of Arduino are you using ... Windows Installer, Windows App or other? I've just run some tests using an ATtiny412 dev board from Azzy's Electronics on tindie. My PC is using Arduino IDE 1.8.13, megaTinyCore 2.05 and Windows 10 ... couldn't get any errors. For testing, here's the board setup I used. (also tested with UPDI as Reset and GPIO). Blink sketch:
void setup() {
PORTA.DIRSET |= PIN7_bm;
}
void loop() {
PORTA.OUTSET = PIN7_bm;
delay(50);
PORTA.OUTCLR = PIN7_bm;
delay(300);
}
After setting up the board or making any changes its options, run "Burn Bootloader" Then upload your sketch using "Upload Using Programmer".
Re: TARGET I am using the ATtiny412 soldered onto an SOIC-8 to DIP-8 converter that is plugged into an empty breadboard (no other connections than the three you mentioned). I do not have a capacitor across the supply voltage but I will try that right now. I put the capacitor in and that seemed to solve the problem. But then once I unplug the capacitor (to make sure I'm not crazy) it still is working! I'm not exactly sure what's going on but it seems like it is working now to program normally. Now, the reason I purchased this high voltage programmer is because I want to be able to use the UPDI pin as an output and (even with the capacitor in there) I am still not able to upload a program that blinks on the UPDI pin.
Re: Arduino Nano and Programmer PCB I'm not sure if it is a clone or not, someone gave them to me for free. Is there an easy way to check and see if it is a clone or not? I followed all the steps to get the jumpers in the right place for PCHV and WP. I am getting a blue LED flash very quickly when I plug in the Nano to my computer so I think that means I am in the right programming mode.
Re: Software: Arduino 1.8.10 for Mac with megaTinyCore 2.0.5 and macOS 10.15.6 I just tested your blink sketch with my setup and it does work properly. To try using the UPDI pin as an output I tried changing PIN7_bm to PIN0_bm to hopefully get that working but even though it compiles and uploads, it doesn't functionally work. It just stays HIGH all the time. I even tried unplugging the UPDI pin and power to the ATtiny412 to see if that would change anything but it didn't, it still just stays HIGH.
Thanks for the quick reply and at least getting the programmer working. Now we just gotta get the UPDI pin setup as an output!
EDIT: Here's the screenshot of what settings I'm using in Arduino for megaTinyCore:
Thank you for your reply ... glad its working!
Now for UPDI as GPIO.
It works!
Thank you so much for your help. A couple of other quick questions:
Yes, optiboot does take up some storage on the chip, probably why its not recommended on the 8-pin chips because there's only 4KB max available, however if your code fits, no problem! Optiboot will also allow for programming through serial (RX/TX) so then you could use a serial adapter. I'm quite sure you could use avrdude directly using a terminal window and change fuse5 to get any desired setting for the UPDI. In this case, you wouldn't need optiboot and get some extra memory. I think the UPDI configuration isn't available (yet) for non-optboot configurations so that users don't inadvertently get locked out of the MCU and find out they don't have a HV programmer.
Yes, the PCHV (Power Cycle High Voltage) option can be used no matter whether your using Optiboot or not. It also doesn't matter how the UPDI pin is configured (UPDI, Reset or GPIO). Only need to disconnect you user circuit - LED.
There's no downside to always using the PCHV option, it will have no effect on the chips life expectancy or reliability as this pin is rated for 13V max. Note that the HV signal is a quick 12V pulse only 700µs in duration. In PCHV mode, A HV pulse is applied when power is connected. Then, anytime you program (burn bootloader or upload) a power cycle is performed and a second HV pulse is sent. Just after programming completes, a second power cycle occurs to re-load the fuses.
Note that for the HV mode of the programmer, it will only apply a HV pulse at power-up. No power cycles occur. This would be used when the target circuit is used to power the programmer for in circuit programming.
Sounds good. Do you know if Dr. Azzy is working on adding UPDI configuration for non-Optiboot based bootloaders in Arduino? I don't really want Optiboot on these 8-pin chips (because you're right, they don't have a lot of storage) but I would like to be able to use that last pin as GPIO and just program using PCHV. I don't really know a lot about fuse setting (except that you have to "burn bootloader" through the Arduino IDE to have them take effect), would you be able to walk me through that?
I'm willing to add an issue/feature request to his repo if you don't know.
He has an issue(enhancement) opened here I'll try using avrdude later this evening and report back.
I just did some looking through Dr. Azzy's boards.txt for megaTinyCore hoping that he might set all the fuses manually when options are selected for GPIO or Reset and I see this:
atxy2o.menu.resetpin.gpio=IO (DANGER - Read docs first! powercycle to enter bootloader)
atxy2o.menu.resetpin.gpio.bootloader.file=optiboot_x/optiboot_txy2{bootloader.uartswap}.hex
atxy2o.menu.resetpin.gpio.bootloader.resetpinbits=00
Which makes me think that there is a lot more in that .hex file that affects the pins besides just the "resetpinbits=00" but again, I'm way over my head and don't want to trash some of my ATtiny's messing around with it.
OK, I'll put the avrdude procedure on hold. Note: If you use the UPDI pin as Reset, you can leave the reset push-button connected while programming. Good luck with your testing!
I would love to see if it is possible just with avrdude whenever you have some free time. In the meantime I'll be on the lookout for a resolution on the enhancement you mentioned in megaTinyCore.
All your help has been greatly appreciated!
Hi,
I recently purchased two of your "Arduino Nano HV UPDI Programmer" from your Tindie shop and just got them in the mail and have been trying to get them up and working. I started by just trying to write a simple blink sketch to the ATtiny412 and sometimes it works and other times it doesn't even though I haven't changed any of the wiring or code. Sometimes I get one set of errors and other times I get other errors and sometimes I don't get any, the one that I get most often is shown below. If I get the other error message again, I'll try and add it to this reply. My current setup includes and Arduino Nano plugged into the Arduino Nano HV UPDI Programmer and the Write Protect jumper plugged in and the PCHV UPDI jumper plugged in. Then the three UPDI pins are plugged directly into the ATtiny412. Thanks for any help!
Here are the most common error messages: