View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
PIC18F458 CAN config mode |
Posted: Sat Sep 09, 2006 1:57 am |
|
|
Hello,
I have a 18F458 which receives data over CANBUS almost every second. I want PIC enter to the CONFIG mode by sending message via RS232.It does what I want only two times.Then it is locked.But when I cut the connection to the CANBUS it works very well.Why doesn't it work while data is coming?
Thanks! |
|
|
iso Guest
|
|
Posted: Mon Sep 11, 2006 1:39 pm |
|
|
If the bus is transmitting or receiving it wont go into config mode.
Put a loop on your enter config code and only break when it sets. |
|
|
Guset Guest
|
|
Posted: Sat Sep 16, 2006 5:39 am |
|
|
Thaks for replying!
I wrote can_abort() to empty the tansmitter buffers before changing the mode,but still it is same. Maybe I need to empty the receiver buffers but there isn't a function for it in the library. However, can the transmitter buffer be full even if the speed of the bus which it is connected is not compatible with the PIC?
There is only problem when I plug the bus cables,which sending data periodically. |
|
|
sjbaxter
Joined: 26 Jan 2006 Posts: 141 Location: Cheshire, UK
|
|
Posted: Sun Sep 17, 2006 10:26 am |
|
|
Have a look at this thread:
Can't get into config mode
It may give you some additional pointers. I seem to remember that not only have the TX registers go to be empty, but the RX pin has to be high before you can get into config mode. _________________ Regards,
Simon. |
|
|
|