|
|
View previous topic :: View next topic |
Author |
Message |
Mark DSylva Guest
|
? wakeup from sleep on I2C interrupt |
Posted: Fri Jan 24, 2003 2:43 pm |
|
|
<font face="Courier New" size=-1>Hello,
I have a problem with some code for the 16F873 (configured with H/W I2C, slave mode) which is supposed to wakeup from sleep mode when a message on the I2C port arrives. I developed and tested all my code using the Microchip ICE2000 with sleep mode turned OFF, as the emulator stops communicating with MPLAB when the micro enters SLEEP.
Everything worked well when I commented out the line that causes the micro to enter sleep, but with that line in, it appears that the first of 5 short ( roughly 4 byte) messages I send to the PIC is not received.
I'm using PCM version 3.104. Has anyone got any suggestions?
I can post some code but I don't know if that is needed yet.
Thanks
Mark
</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10975 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: ? wakeup from sleep on I2C interrupt |
Posted: Fri Jan 24, 2003 3:30 pm |
|
|
:=I have a problem with some code for the 16F873 (configured with H/W I2C, slave mode) which is supposed to wakeup from sleep mode when a message on the I2C port arrives. I developed and tested all my code using the Microchip ICE2000 with sleep mode turned OFF, as the emulator stops communicating with MPLAB when the micro enters SLEEP.
:=
:=Everything worked well when I commented out the line that causes the micro to enter sleep, but with that line in, it appears that the first of 5 short ( roughly 4 byte) messages I send to the PIC is not received.
:=
:=I'm using PCM version 3.104. Has anyone got any suggestions?
----------------------------------------------------------
See Figure 12-11 of the 16F87x data sheet. It shows the timing
diagram for "Wake-up from Sleep through Interrupt". There is
a delay of 1024 Tosc (ie, 1024 clocks) before the PIC wakes up.
With a 4 MHz crystal, this would be 256 usec. Is this long
enough to account for your missing bytes ?
I assume you're now testing the circuit without the ICE.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10976 |
|
|
Mark DSylva Guest
|
Re: ? wakeup from sleep on I2C interrupt |
Posted: Mon Jan 27, 2003 8:20 am |
|
|
:=----------------------------------------------------------
:=
:=See Figure 12-11 of the 16F87x data sheet. It shows the timing
:=diagram for "Wake-up from Sleep through Interrupt". There is
:=a delay of 1024 Tosc (ie, 1024 clocks) before the PIC wakes up.
:=With a 4 MHz crystal, this would be 256 usec. Is this long
:=enough to account for your missing bytes ?
:=
:=I assume you're now testing the circuit without the ICE.
Thanks, It's working now... I should have checked that the data sheet which I was using was the most recent, it was an advance version and this data was not in it. I'll have to make sure I have the latest data sheets next time.
And yes, I am not using the ICE now, but a FLASH part.
Mark
___________________________
This message was ported from CCS's old forum
Original Post ID: 11031 |
|
|
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|