View previous topic :: View next topic |
Author |
Message |
part-bin Guest
|
can wake-up/corrupt project |
Posted: Sat Jun 02, 2007 6:10 pm |
|
|
Hey,
I have a CAN device that wakes on bus activity. When I open the project and do compile and program to the proto it works fine. Any subsequent compile,program sequence and it works but won't wake on bus activity.
when i close the project and then re-open it and do a compile, program sequence the proto again works correctly.
Any thoughts?
I thought maybe I had a corrupted project but rebuiding in a new project didn't change anything.
Using PIC18F4680; PCH 4.036(downloaded 2 days ago)
MPLAB 7.60
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Jun 02, 2007 6:40 pm |
|
|
What was your previous compiler version ? Check if your problem
is caused by the change in the behavior of the "address of" operator
starting with vs. 4.021. Read this thread and the links in it.
http://www.ccsinfo.com/forum/viewtopic.php?t=30623 |
|
|
Guest
|
|
Posted: Sat Jun 02, 2007 8:13 pm |
|
|
No, I already went through that some versions ago.
What causes a corrupt project anyway?
What I really can't get is that it works the first time but not after that.
usually its good or no good. not in between. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 03, 2007 12:55 am |
|
|
1. Startup MPLAB. Compile the file. Program it into the PIC.
2. Re-compile. Click the Verify button in the ICD2 toolbar in MPLAB.
This will tell you if the code is different. If it verifies OK, then you
can start looking for the problem elsewhere. |
|
|
Guest
|
|
Posted: Sun Jun 03, 2007 5:35 am |
|
|
great suggestion. But that wasn't the issue. I removed the #use fast_io statments for the ports and it all works now. I can only guess that the TRIS seting for CANR(RB3) is not retained when the device sleeps. Upon the next period of bus activity the CANR pin is not an input and it never generates the interrupt to wake up the PIC. I will have to investigate further when I have some time.
Thanks for your help |
|
|
|