View previous topic :: View next topic |
Author |
Message |
mahi
Joined: 31 Oct 2011 Posts: 1
|
CAN simulation in proteus using CCS compiler |
Posted: Mon Oct 31, 2011 9:34 pm |
|
|
Hi
I am trying to simulate can in proteus. I am using PIC18F4680. When i simulate code in proteus can_init() function gives message " read can controller register CANSTAT returns last value stored. The program is stuck over here and further statements are not executed. Any suggestions would be welcome |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9236 Location: Greensville,Ontario
|
|
Posted: Tue Nov 01, 2011 5:17 am |
|
|
You'll have to show us your code, at least the smallest, compilable program that has the fault. Also supply the compiler version. Be aware that Proteus is full of bugs, errors and bad DRCs so the real problem could be Proteus and not your code. It is always best to use real hardware. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Tue Nov 01, 2011 10:18 am |
|
|
Looking at the error message, I'd say Proteus problem.
It seems to be saying that 'CANSTAT' returns the last value stored. However CANSTAT, is a read only register, so can't even have a 'last value stored'.
CCS read this in the init, when they switch the mode of the can peripheral and wait for the peripheral to say in CANSTAT, that it has switched to that mode.
Best Wishes |
|
|
future
Joined: 14 May 2004 Posts: 330
|
|
Posted: Tue Nov 01, 2011 5:14 pm |
|
|
As far as I know, CAN is not implemented in Isis. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Wed Nov 02, 2011 2:54 am |
|
|
That would certainly explain it!.....
Best Wishes |
|
|
|