I am trying to upload code to an attiny84a with a cheap FTDI serial adapter. I am using ATTinyCore with the attiny and trying to use it's support with optiboot.
This is how I first flashed the bootloader to the attiny84a through ISP. I connected my clone nano board (with the Arduino as ISP sketch flashed) to the ISP pins for the attiny, and sucessfully flashed the bootloader for it with these settings:
I then disconnected the nano board and hooked up the FTDI serial adapter as so: VCC - VCC, GND - GND, Tx - A2, Rx - A1, and DTR to a 0.1uF ceramic capacitor that connects to the RESET pin. On that RESET pin I also connected a 10K pullup to VCC and a shotky diode facing VCC. I then plugged in the serial adapter to my computer, opened up a new "bare minimum" sketch, pulled up the same settings as in the picture above, and hit "upload", and it gave me this error:
I tried this many times with different variations and I still got error's like this. It's possible my serial adapter doesn't work as I have tried uploading code with it to other microcontrollers with no success, maybe there is something I could do to test it?
Here is a photo of my setup:
Optiboot works on the 84A. I've got one sitting in front of me blinking away at the moment.
The reason you don't see Bootloader UART on the 84A is that you don't have a choice of which to use. On the 841 you can choose between UART0 and UART1. On the 84A it's software on PA1 and PA2, period.
You may need to tune the internal oscillator to get it accurate enough for serial comms. At the moment I'm using an external 8MHz crystal and a couple of caps. Works a treat. I'm going to play around with OSCCAL and see how that goes.
Edit: I've gotten OSCCAL dialed in on one of my 84As in the sketch and have serial comms working. I'd have to adjust the value in the bootloader for that to work with the internal oscillator.
Okay thank you. I was confused why the attiny84a wouldn't have software serial support after reading so much that it did. I will try to figure out how to calibrate the internal oscillator.
And as for Bootloader UART not showing up as an option, that would seem to just be common sense. When there's only one choice, it's not an option to set. You don't see it when you're using a 328P on an Uno or Nano, after all. But that doesn't mean that a bootloader doesn't work on a 328P.
I switched the voltage on my serial adapter to 3.3v after looking at that chart, and was easily able to upload code to it! I guess the oscillator wasn't close enough in spec for 5V, but is for 3.3V?
If you look up a few replies, you see that the datasheet says that the internal oscillator is calibrated for 8HMz at 3V (and that its frequency is dependent on voltage and temperature). So it's likely a lot closer to that nominal 8MHz value at 3.3V than it is at 5V. The one I was tinkering with was running at about 8.3MHz at 5V.
Well thank you so much for the help. I am now looking at getting the ATtiny1606 and using it with megaTinyCore since it has hardware serial, and a more acurate internal oscillator.
EDIT: or maybe the ATtiny1616 as it isn't marked as "not recommended" for optiboot.
If you're going to the ATtiny1616 or anything else in that series, look at UPDI programming. No bootloader required, and you can even program it with the same FTDI232 interface that you'll use for serial.
It's pretty simple. You specify the programmer as serialupdi57k and upload to the same port you'll use for serial comms. The DTR pin determines whether it's programming (when it's high) or doing serial (when it's low). Here's what the FTDI+4053 version ends up looking like: