On existing hardware with 18f258 the following code works, but when recompiling with the same compiler for 18f2580 on the same hardware but with 2580 cpu of course the program halts after the second spi_write..
Debugging this gives that...
004E: MOVF FC9,W
0050: MOVLW 02
0052: MOVWF FC9
0054: BTFSS FC7.0 <---
0056: BRA 0054
..it gets stuck at the bit test which will never become true causing an infinite loop between address 56-54. However if I insert a microsecond delay between the writes it will work.
The data sheets between the cpus are the same for SSPSTAT register.
Can anyone shed any light on this ?
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Tue Sep 16, 2008 1:57 pm
I didn't see an errata for that problem in the 18F2580 errata sheet.
But Microchip may well have a bug in the MSSP for that PIC that they
haven't found yet. Here's the errata for another 18F PIC. In the
upper left corner of page 2, they tell you to add a delay between
successive writes to the SSPBUF. That's a work-around for a bug.
You have probably found a similar bug. Maybe you should report it.
http://ww1.microchip.com/downloads/en/DeviceDoc/80293a.pdf
treanla Guest
Errata
Posted: Wed Sep 17, 2008 2:49 am
Thanks for finding that other errata sheet, it certainly seems to exist a similar problem with 2580 as with 2510. I have reported it to Microchip.
Lets see what happens....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum