Sharing Programming Pins

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay, I've designed a small board targeted at giving people some SMD soldering practice. It's got an SOIC-14, some SOT23-3s, 0805 resistors, 0603 capacitors, a tactile switch, etc. -- so far so good. I built up the prototype yesterday and aside from a stupid reversed footprint everything works just as expected... except programming. The board is based around an AtTiny24A and is designed to use ISP for programming. I've been able to program it, but it's flaky; very flaky. Not only has it failed to read the signature properly ( intermittently ) but it has actually failed to read and write properly after a successful signature verification. I haven't slowed the bit clock as much as I could ( I'm the chip at 1MHz, IRC @ 8MHz and CLKDIV8 enabled ). I have made sure that I'm below 250kHz though.

I've never had these sorts of issues with programming an avr, it either works or I've wired it incorrectly -- not this time. The problem seems to be that the RGB LED on the board is being driven by mosfets that are tapped from two of the programming lines ( I don't have access to an o-scope to check the waveforms unfortunately ). The fets I'm using have a gate capacitance of 40pF ( worst case ). Is that too much ( obviously... ).

So the question, since I have to respin the boards to fix the footprint foible anyway, do I insert resistors in series with the fet gates, or do I just give up those pins and play it safe? Thoughts?

Martin Jay McKee

As with most things in engineering, the answer is an unabashed, "It depends."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

So the question, since I have to respin the boards to fix the footprint foible anyway, do I insert resistors in series with the fet gates, or do I just give up those pins and play it safe? Thoughts?

It depends on your end goal. We have apps with lower pin-count devices where "interfering" app circuitry needs to be hanging on ISP pins. In one case (now that we are in production) we mount the MOSFET >>after<< ISP is done. ;)

In a couple other cases, we just go waaayyy slllooowww during ISP, and it works OK. So try that first. (As these simple apps have small programs and our volumes are modest it isn't too painful a wait.)

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I recall correctly, AVRs generally are programmed by the ISP device pulling down the MOSI, MISO, and SCK lines from VCC. The ISP programmer opens a connection to ground which happens in pico seconds. Where residual capacitance (spelling error?, sorry) affects the clock speed is when the ISP line goes back to VCC because the internal pull-up resistor is rather high. This creates an R-C time constant that prevents the MOSI/MISO lines from being in a solid logic state when read by the AVR during programming.
However the ISP programmer is most likely putting out enough current to 'blast through' a couple of 40pF loads.
I've learned not to completely trust my electronic theory skills and warmly welcome any necessary corrections to my analysis of circuitry. But if the MOSFET capacitance is causing problems, try adding 1-5K ohm resistors between the MOSI/MISO lines and VCC. This is what the I2C spec says to do and it runs at about the same speed (@100-500K clock cycles/sec) as the ISP in most programmers.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would try setting the programmer to the lowest frequency. If that works, try to increase.

It all starts with a mental vision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the thoughts. I will definitely try slower speeds. The ability to program the boards was actually an after thought. I'm planning on programming the uCs before people assemble the boards -- reprogramming them could come later.

If nothing else, they are not too difficult to program with hvsp either.

Martin Jay McKee

As with most things in engineering, the answer is an unabashed, "It depends."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I finally had a chance to get back to testing the board's programming at low speeds and, at first blush, it seems reliable. All things considered, it's not too bad given that it's only a 2k part. It might start seeming a bit slow if I increase to the AtTiny84, but that's quite unlikely.

Thanks all for the nods that it should, indeed, work if it's slow enough. Now to finalize the demo code and prepare the structure of the first workshop!

Martin Jay McKee

As with most things in engineering, the answer is an unabashed, "It depends."