issues programing.. attiny85 and 328p 8MHz - Page 1
Forum section: electronics / general

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 11, 2019, 05:57:22 am
content: so i made these .... and they work i programed them before ..... but that was a few months agao...I cant seem to get them to work now...first issue i saved the bord manager stuff on a usb , and i moved it to the "hardware" folder when i do that it does not open arduino anymore ....so i tryed to download the bords i need using the URL optionthis one:-------------------------------------ATFlash:https://mesom.de/atflash/package_atflash_index.jsonEngage the following controllers with 8 MHz (and 9600 Baud) standalone on breadboard (without anything else!):ATtiny84AATtiny85ATmega328PAll can be programmed via an UNO and the integrated Tiny Safe Boot (TSB) bootloader or the integrated ISP programmingMore on the ATFlash website-----------------------------------------Its not working for me..... i get all sorts of errorsError compiling for board ATtiny25/45/85.It was a lot easier when i could just copy the files i had to the hardware folder but when i do that it wont open arduino....What can i do to fix this where do i start?

author: sleemanj
author_rank: Super Contributor
timestamp: March 11, 2019, 06:29:28 am
content: For ATTTiny use my fork of tiny corehttps://github.com/sleemanj/optiboot/tree/master/dists#attiny25-attiny45-attiny85For ATMega use my distribution of boardshttps://github.com/sleemanj/optiboot/tree/master/dists#atmega-x8-series-84888168328Ensure your IDE is up to date.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 11, 2019, 06:48:13 am
content: The attiny85 worked great!Im still having issues with the atmega328p-puavrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10avrdude: initialization failed, rc=-1Double check connections and try again, or use -F to overridethis check.avrdude: stk500_disable(): unknown response=0x12the selected serial port avrdude: stk500_disable(): unknown response=0x12does not exist or your board is not connectedIll keep trying the attiny one worked very well tho!

author: sleemanj
author_rank: Super Contributor
timestamp: March 11, 2019, 06:59:10 am
content: That type of error usually indicates a physical problem, most likely a problem triggering reset on the target at the right moment.See herehttps://forum.arduino.cc/index.php?topic=342977.0

author: Kilroywashere
author_rank: Regular Contributor
timestamp: March 11, 2019, 07:10:55 am
content: Quote from: sleemanj on March 11, 2019, 06:59:10 amYou got it ! thank you so much ... yeah it was the triggering reset put a cap on it and it worked great!

author: Peabody
author_rank: Super Contributor
timestamp: March 12, 2019, 01:33:30 am
content: Quote from: sleemanj on March 11, 2019, 06:29:28 amI'm not clear about how a bootloader works for the ATTiny85. Do you use a standard FTDI adapter and its driver to upload new firmware? If so, what pins are RxD and TxD on the 85? I don't see anything in the datasheet about that.I've been looking at the Digispark and Adafruit ATTiny85 boards, and they have bootloaders too. But they appear to connect two I/O pins directly to the USB data pins, and they have their own USB drivers, so it's hard to tell exactly what they are doing, or whether standard UART stuff is involved at all.Anyway, I would appreciate a bit more information on how this all works.Thanks

author: sleemanj
author_rank: Super Contributor
timestamp: March 12, 2019, 04:52:30 am
content: Quote from: Peabody on March 12, 2019, 01:33:30 amWith my distro, yes you can (assuming you burn the bootloader of course, for which you need to do so using a programmer as usual), it uses a software serial implementation for the x5 series.In my distribution RX and TX are assigned to the pins shown (this works for uploading over bootloader and using the default Serial implementation also)QuoteThey use a different bootloaderhttps://github.com/micronucleus/micronucleuswhich does software USB and does not use avrdude to upload, I'm not a total fan of that approach since it sucks away over 1.5kb of space for just the USB bootloader (compare optiboot, 600 bytes).

author: Peabody
author_rank: Super Contributor
timestamp: March 12, 2019, 02:09:33 pm
content: Thanks very much for the explanation. And I assume that the compiler knows, from boards.txt or whatever, to skip over those 600 bytes when compiling your sketch. Well you know UART uploading for a Tiny would be the same as for a Mini, or any Arduino without a built-in USB adapter. I don't really see the advantage of the USB alternative, particularly since you have to install a driver in Windows.A friend gave me an Adafruit Trinket. It uses pins 3 & 4 for USB. It looks like I could cut those traces, then install your bootloader in it. USB could still be used for power if needed.The tuning feature is very interesting. Is there an Optiboot tuning bootloader for the 328P so you could do without the crystal, at least at 8 Mhz?

author: sleemanj
author_rank: Super Contributor
timestamp: March 12, 2019, 09:42:40 pm
content: Quote from: Peabody on March 12, 2019, 02:09:33 pmYes boards.txt specifies the maximum flash size, which takes into account the necessary space for the bootloader. The bootloader is stored at top-of-flash.Quote from: Peabody on March 12, 2019, 02:09:33 pmYes my diy atmega distribution has tunable bootloaders for common internal oscillator frequencies.Board Manager URL:https://raw.githubusercontent.com/sleemanj/optiboot/master/dists/package_gogo_diy_atmega8_series_index.jsonSelect the appropriate chip options from the boards menu after installing and Burn Bootloader.

author: Peabody
author_rank: Super Contributor
timestamp: March 13, 2019, 04:30:12 am
content: Thanks. So your Optiboot is a fork of the main Optiboot. Does your version for the 328P, 8 MHz, internal, also fit in 512 bytes?

author: sleemanj
author_rank: Super Contributor
timestamp: March 13, 2019, 04:57:12 am
content: Quote from: Peabody on March 13, 2019, 04:30:12 amYes