ISP and application board

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

Hi Freaks,
I am trying to design an application that uses Attiny24. This is a handheld app. and I would like it to have ISP capability so I can reprogram it on the board and don't have to remove the micro from the board. I know the Tiny has the 6 pins needed for the ISP connector.

Since the three pins (7,8,9) can be used as ports as well, is it possible to hook these pins up in my board in such a way so they can be used as general purpose input/output pins and also be able to use them as ISP pins? Can there be a switch on my board that will choose between ISP function or normal port pins? Or does this have to be in software?
Thanks.

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

The answer is yes and no.
The problem arises when you ISP. Since the signal levels of ISP are the same as I/O, you could fire off a relay or whatever you should not have. If the pin is used as an input, then the low impedance of the device connected to it could make life hell as well.

The switch idea is the best. Use a CD4066, it has four bi-directional switches in it. You connect all the enable lines to the switch and use the switch to enable the I/O or disable it. The ISP pins stay on the AVR side of the CD4066

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

It all depends on the hardware you have connected to the ISP pins.

For example if the pins are just say switch inputs or just connected to a reasonably high-impedance load, then the ISP will "overrule" them.

So you connect the ISP header when required. If yo have a heavy load like a high-current LED then you may need to add a removable jumper. A normal LED is probably fine.

David.

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

In general, our production apps are able to be ISPed with attached circuitry, and we have yet to put in a signal switch. But some care must be taken at system design time with pin allocation.

Now, all of the below may not apply with your "highest value" ISP setup; ;) we use mostly STK500 and ATAVRISP2, and sometimes NPE keyfobs.

It does get a bit more funky on smaller pin count AVRs; there aren't as many choices of pin allocation.

1) In general, the ISP pins are the SPI pins. Any attached devices must be pulled to the "not selected" state when the AVR is in reset to abvoid ISP interference. This is a good practice anyway.

2) On the Mega128-class with RXD0/TXD0 used for ISP, a series resistor is needed between the ISP connection and any transceiver that might be on RXD0.

3) Sinking indicator LEDs are generally OK.

4) Pushbuttons and switches: if a "tame" app with limited reprogramming done, these will be OK as long as they are open during ISP.

5) Output devices, such as to a MOSFET switching something: take care that if the output then switches during ISP, it is safe for man, beast, and equipment.

6) Sometimes attached circuitry can add capacitance. Often slowing down the ISP bit rate will then allow it to be done reliably. In one case we have to short a cap for ISP.

Lee

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

Ok thanks for the ideas,Guys.

I looked harder at what I need, and realized that I am going to need to use the three wire communication to get data from another AVR.

So can I multiplex the ISP and SPI pins?

This will give me the following:

1) Use pins 7 (MOSI,DI), 8 (MISO,DO) and 9 (USCK,SCL) for getting data from AVR. (I am going to need two way communication between both AVR's). I am planning to use master/slave config. for this.

2) Use the same three pins for programming with a 10 pin ISP connector.

Is this doable? If yes, will I need any additional resistors /hardware to achieve this?

Thanks again.

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

You could always program a booloader into the device (if there's room)

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

Quote:
a series resistor is needed between the ISP connection and any transceiver that might be on RXD0.
You might as well tell him the value of the resistor and the appropriate docs where you got that from, otherwise it may not work. :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Ok thanks for the info,Cliff.

John,
I am still in learning mode and I understand I may ask some stupid questions or may take longer to understand the answers. My apologies for this but everyone has to start somewhere and I am sure you understand. Thanks.