Well... It wasn't the code.. The new simulator is broken with the M8 SPI (and others?) If you load a byte into SPDR after setting the SPI up as a master, then wait for the SPIF bit to go high indicating the byte has been sent, you'll wait forever. If you don't use the SPI2X feature, then it at least appears to work, but then it has the problem as below on the ICE-50 It's even wierder in the ICE-50, if you step it, it appears to never set the flag. If you use run to breakpoint, then you'll get various times to completion, all longer than it should take (2uS at max speed) some almost 3-4x longer than it should take. The hardware (chip) appears to work right. Also, FWIW, the sim will NOT detect that you are doing something like: ld TEMP,Y+ when Y is pointing to ramspace that does not exist in your device. The ICE-50 does detect this. Finally, the WDT in the M8 appears to be resetting me at 500mS intervals, even though it's set for 2S, according to the data sheet. (0x0F in WDTCR) Are we having fun yet?
Message
SPI on Mega-8
2004-01-23 by Dave VanHorn
Attachments
- No local attachments were found for this message.