PORTB and ISP

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

On the atmega168, PORTB pins 2 through 5 are used for in-system programming. Is it safe to use these pins as outputs?

In other words, if I solder up a permanent circuit with PB2..5 connected to both an ISP header and my output lines, would I still be able to use ISP and have my circuit run normally without things going haywire?

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

Yes, but be careful. If you have an output driving one of those pins put something like 100 ohm in series so that the ISP doesn't get shorted out. Also make sure that if a pin is toggled by the ISP that it doesn't drive something like an explosives detonator, the results could be interesting to say the least!

Some early designs used to use a CMOS analog switch to isolate the ISP from the processor chip.

John

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

Quote:
Some early designs used to use a CMOS analog switch to isolate the ISP from the processor chip.
can someone recommend something like this to me? i'm making an atmega8 educational board and would like to use PB3(Mosi), PB4(Miso) & PB5(Sck) for my infurious needs :lol: i would like to isolate the ISP and those pins from the rest of the board while programming.
the solution i came upon are jumpers but it would be a pain in the ass to switch three jumpers every time i want to program the chip. is ther any way i can solve this with some type of cmos or ttl logic and one switch or jumper?

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

I'm new to this, but I thought devices on the SPI bus tristate their pins when they are not "selected" by SS. And I also thought ISP programmers tristate their pins when they are not programming.

So there should not be any interference issue, correct?
(At least that has been my observation, with the AVRISP2 programmer).

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

Quote:

So there should not be any interference issue, correct?

Maybe not though I know that my STK500 interfered with the operation of an attached AT45 when it was supposedly "inactive". So I'd always detach the programmer if doing something that shares the ISP pins myself. YMMV.

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

what if i isolate the power supply. i could add a jumper that switches vcc only on the microcontroller when programmed and the rest of the circle is disconnected. that's a lot easier then switching three jumpers every time i want to program it. i intend to use portb pins only to drive an uln2003. would that work?
edit:
@clawson

Quote:
AVR STK500 ISP isolator circuits
While developing a circuit for driving high-power LEDs, using the Atmel » AVR RISC ATTiny15L microcontroller », we discovered a flaw in the AVR STK500 starter kit; the three lines providing in-system programming (ISP) are permanently connected to the microcontroller (PB0 through PB1 on the ATTiny15).
a solution can be found here using MC14503B:
http://www.speleogroup.org/ISPisolate.html
miso/mosi/sck are disconnected while reset is not pulled low. any idea what can be used to replace MC14503B? i would like to buffer my isp but MC14503B is not available in croatia :cry:

Attachment(s): 

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

It might help to read AVR042: AVR Hardware Design Considerations from http://www.atmel.com/dyn/product.... If you are not driving the SPI lines (using your custom circuit) while programming, you should be fine without any switches or logic chips.