ATmega169 Puzzle

Mar 21, 2008 3 Replies

Well a few days ago I was having trouble setting up a simple spi interface Whenever I would try to lower the chip select lines of my devices the 16 would try it and then give up and reset itself.



I finally figured out that the problem was the pin I was trying to use. was using PINB0 and PINB4 as chip select lines. B4 was the one giving m trouble so I switched it to B5 and the problem was solved. Now I' noticing that PINB6 does the same thing.



What is going on here???


Maybe you have interrupts enabled (by accident) on those pins, and no valid handler ?

69

Single-step; there is no reason why you shouldn't be able to use any GPIO as your SPI _SS. Also check that your circuit is not wired in some funky way whereby asserting _SS was shorting out the power supply.

This may be the perfect time to leave the embedded/digital world for a minute, hang a scope on it and take a look.

Regards, Joerg http://www.analogconsultants.com/

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required