Issue programming ATTiny using ICSP - Page 1
Forum section: electronics / projects

author: jsquaredz
author_rank: Contributor
timestamp: May 31, 2015, 02:22:56 pm
content: Having an issue programming my ATTiny85 using the in circuit programming header. Here is a schematic of the design. Please take a look and tell me if you see something electrically that may be an issue. I checked it a few times and I think its right, but I cant seem to get Arduino IDE to talk to it.

author: georges80
author_rank: Frequent Contributor
timestamp: May 31, 2015, 04:05:14 pm
content: You have the output of your opamp (IC1G2) 'fighting' to drive the SCK pin that the programmer is also trying to drive during ISP programming.... Bad...cheers,george.

author: Jerby
author_rank: Newbie
timestamp: May 31, 2015, 04:07:08 pm
content: Do you remove the LM358 before programming? else clock signal will not come trough.

author: jsquaredz
author_rank: Contributor
timestamp: May 31, 2015, 04:07:19 pm
content: Quote from: georges80 on May 31, 2015, 04:05:14 pmOk. Good catch. I can break the output of the opamp with a jumper.

author: jsquaredz
author_rank: Contributor
timestamp: May 31, 2015, 05:21:13 pm
content: Quote from: Jerby on May 31, 2015, 04:07:08 pmWorked like a charm. Thanks. Any suggestion on future design to avoid this? Is a jumper the only option?

author: georges80
author_rank: Frequent Contributor
timestamp: May 31, 2015, 06:34:15 pm
content: Quote from: jsquaredz on May 31, 2015, 05:21:13 pmA tiny85 has so few pins to play with that most designs need to use some of the ISP pins as general purpose i/o or adc etc, so you pretty well have no choice in those cases than to use jumpers etc.You could put say your switch input onto the SCK line (don't press the switch during programming...) and move the opamp output to what was the switch i/o pin. Basically you don't want any of the ISP pins to be driven by your external circuitry during programming.I tend to use the tiny861 in many of my designs since it isn't much larger (in qfn form) than a tiny85 and has many more i/o pins so you don't need to have the ISP pins do double duty.cheers,george.

author: Dragon88
author_rank: Regular Contributor
timestamp: May 31, 2015, 07:34:05 pm
content: For one-off projects that use a DIP attiny85, I usually just socket it and program the chip before I seat it. This can be slightly annoying if you need to pull the chip a few times to re-program while debugging, but it's not much worse than fiddling with jumpers, etc.You could probably design some fancy solution with a quad SPDT chip and a button to enter programming mode, etc etc, but at that point you're better off just using an ATTINY841 instead.

author: eneuro
author_rank: Super Contributor
timestamp: May 31, 2015, 07:53:17 pm
content: Quote from: jsquaredz on May 31, 2015, 05:21:13 pmIt looks like you have some switch on PB4, but not sure what you output from LM358 pin 7 to MPU PB2 (using logic I/O, ADC, comparator or simply INT) ?You have ADC on Pb4, so why not to exchange LM358 pin 7 with switch on PB4-if it is in default open state?You don't need any jumper between opamp an MPU nomore, but it depend what is going on in your MPU software

author: georges80
author_rank: Frequent Contributor
timestamp: May 31, 2015, 08:03:24 pm
content: Quote from: eneuro on May 31, 2015, 07:53:17 pmYes, I already stated the same possibility in Reply #5...cheers,george.

author: ajb
author_rank: Super Contributor
timestamp: May 31, 2015, 08:57:04 pm
content: No need for a switch. Just put a resistor between the output of the lm358 and the MCU. Make sure the ISP connections are made on the MCU side of the resistor. That allows the programmer to take priority on the SCK pin without having to fuss with jumpers or switches, and the resistor (a few k) will have no ill effect on the lm358/when the programmer is inactive.

author: con-f-use
author_rank: Unknown
timestamp: May 31, 2015, 09:41:24 pm
content: I don't know what impedance the LM358 output has, but a 3k (or so) resistor at the end of the LM358 output, might not get in the way of the ATTiny's ADC but will make the ISP's SCK signal the dominant driver on that pin, when it's connected.

author: jsquaredz
author_rank: Contributor
timestamp: June 07, 2015, 11:24:11 pm
content: Quote from: ajb on May 31, 2015, 08:57:04 pmThis worked perfectly. Awesome tip. Thanks.