(solved) stk500_getsync(): not in sync and using nano to shrinkify to attiny85 w

(solved) stk500_getsync(): not in sync and using nano to shrinkify to attiny85 winxp

Botton line: in the development window "files>preferences" turn on the verbose for uploading.
Scrutinize the command sent to avrdude. The baudrate should be 19200. The fix is is to edit the file programmers.txt (arduino-1.0.1-windows\arduino-1.0.1\hardware\arduino\programmers.txt) to change "arduinoisp.speed=9600" to "arduinoisp.speed=19200".

fyi: in the same directory is a file "boards.txt" which contains the baudrates for the various boards when NOT used as an "Arduino as ISP", but rather for regular nano code development.

Ok, here's the long story for those who who might be interested in the same route of development with a nano and shrinkifying to an attiny.

I couldn't see a reason why the method used by others with a duemilanove or uno as a programmer would be any different than a nano as they both used the 328. After a frustrating try (including hv programming method), and since my purchase of attinys came from a not well known distributor, I decided I had to purchase a dedicated and known good programmer (a usbasp). That worked fine. Eventually however, enough plugging and unplugging and the need to readback an analog value (via serial) steered me towards ISP with TinyISP. I set that up but was now back to having to fix the original "not in sync" problem as that isp method also gave the error. So to clarify for others: the nano gets loaded (via the bootloader) code (eg: the TinyIsp.pde) at 57600. Then the nano configured as a programmer "uploads using programmer" at 19200. Then for me, debugging on the "serial monitor" occurs at 9600 baud. Here, I make the windows "control panel>hardware>device manager>com5" setting to the same as sometimes I may use a "ftdi breakout board" as an alternate serial converter for monitoring.

I just got this working but decided to write it up as I see others still encounter "not in sync" errors. Now the downer :frowning: The 2nd reprogramming using the TinyIsp failed with the "Yikes! invalid device signature". The general known fix is to manually execute the avrdude command (in a cmd window - ugh!) with the -F force option. That worked. That's where I'm at now. Pilot error - had a miswiring of the reset line. Programs the attiny85 with TinyIsp fine now :slight_smile:

Coding Badly's tinyisp, knock bang and summary by Rudolf Reuter - thanks much Coding Badly and Rudolf!
http://arduino.cc/forum/index.php/topic,123388.30.html

http://www.rudiswiki.de/wiki9/AVRTinyISP

other errors I encountered along the way:

pcrel error
http://arduino.cc/forum/index.php/topic,60649.0.html

reset diode on nano probably warranted to prevent excessive + swing on reset line that can put it in hv mode.

original post
http://arduino.cc/forum/index.php/topic,124564.0.html

A tip: one forum posting regarding serial debugging suggested obtaining a ftdi breakout board. But we've got that much already on the nano! There is a series resistor coupling the ftdi rx pin to the 328's D1. One can simply add a wirewrap pin in a spare hole and wire it to the fdti rx node and you have your breakout board (signal "isolated" by that series resistor).

And another nano improvement - as posted elsewhere in the forum, the nano's fdti "test" pin should be grounded (done with a solder blob) according to the data sheets.

One other issue, I think it's still correct that analog adc2(PB4) might have an issue specifically when wanting "input_pullup" configuration. If you can, it's best to use something like adc3(PB3) to avoid a problem.