Author Topic: Issue programming ATTiny using ICSP  (Read 6054 times)

0 Members and 1 Guest are viewing this topic.

Offline jsquaredzTopic starter

  • Contributor
  • Posts: 45
  • Country: us
Issue programming ATTiny using ICSP
« on: May 31, 2015, 02:22:56 pm »
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.
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 916
  • Country: us
Re: Issue programming ATTiny using ICSP
« Reply #1 on: May 31, 2015, 04:05:14 pm »
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.
 

Offline Jerby

  • Newbie
  • Posts: 6
Re: Issue programming ATTiny using ICSP
« Reply #2 on: May 31, 2015, 04:07:08 pm »
Do you remove the LM358 before programming? else clock signal will not come trough.
 

Offline jsquaredzTopic starter

  • Contributor
  • Posts: 45
  • Country: us
Re: Issue programming ATTiny using ICSP
« Reply #3 on: May 31, 2015, 04:07:19 pm »
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.

Ok.  Good catch.  I can break the output of the opamp with a jumper. 
 

Offline jsquaredzTopic starter

  • Contributor
  • Posts: 45
  • Country: us
Re: Issue programming ATTiny using ICSP
« Reply #4 on: May 31, 2015, 05:21:13 pm »
Do you remove the LM358 before programming? else clock signal will not come trough.

Worked like a charm.  Thanks.  Any suggestion on future design to avoid this?  Is a jumper the only option?
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 916
  • Country: us
Re: Issue programming ATTiny using ICSP
« Reply #5 on: May 31, 2015, 06:34:15 pm »
Worked like a charm.  Thanks.  Any suggestion on future design to avoid this?  Is a jumper the only option?

A 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.
 

Offline Dragon88

  • Regular Contributor
  • *
  • Posts: 88
Re: Issue programming ATTiny using ICSP
« Reply #6 on: May 31, 2015, 07:34:05 pm »
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.
 

Offline eneuro

  • Super Contributor
  • ***
  • Posts: 1528
  • Country: 00
Re: Issue programming ATTiny using ICSP
« Reply #7 on: May 31, 2015, 07:53:17 pm »
Is a jumper the only option?
It 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  :popcorn:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
“Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I have really worked, is mine”  - Nikola Tesla
-||-|-
 

Offline georges80

  • Frequent Contributor
  • **
  • Posts: 916
  • Country: us
Re: Issue programming ATTiny using ICSP
« Reply #8 on: May 31, 2015, 08:03:24 pm »
Is a jumper the only option?
It 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  :popcorn:

Yes, I already stated the same possibility in Reply #5...

cheers,
george.
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2733
  • Country: us
Re: Issue programming ATTiny using ICSP
« Reply #9 on: May 31, 2015, 08:57:04 pm »
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.
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
Re: Issue programming ATTiny using ICSP
« Reply #10 on: May 31, 2015, 09:41:24 pm »
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.
 

Offline jsquaredzTopic starter

  • Contributor
  • Posts: 45
  • Country: us
Re: Issue programming ATTiny using ICSP
« Reply #11 on: June 07, 2015, 11:24:11 pm »
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.

This worked perfectly.  Awesome tip.  Thanks.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf