CAN-bus bug or intended?

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

CAN-bus bug or intended?

Postby D.Bouchier » Tue Oct 19, 2010 9:18 am

Hello,

I was testing a little bit with the CAN-bus on the MIAC and discovered that if you reset the variable that is used as return value for CheckRx at the start of your programm (after CANinit, before the main loop) that the interface does not work.

I have the urge to define all variables in start-up to prevent any unwanted values, so I learned this the hard way ;)

But it does work if you reset the variable to 0 before the CANinit macro, therefore I think the variable is used in the CANinit and needs this to work when it's being written by CheckRx.

This is a little awkward if you're used to C-programming because it's not a visible return value for the CANinit macro and not a visible parameter for CheckRx.

So yea, I solved it myself, but just a heads-up for anyone else who's interested.

Greetings

User avatar
Benj
Matrix Staff
Posts: 14577
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4605 times
Been thanked: 4241 times
Contact:

Re: CAN-bus bug or intended?

Postby Benj » Tue Oct 19, 2010 10:45 am

Hello,

I have not come across this problem. Seems very odd to me. Maybe you could post up a simple example that demonstrates this problem.
These users thanked the author Benj for the post:
D.Bouchier (Fri Oct 22, 2010 6:32 am)
Rating: 5.26%
 

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: CAN-bus bug or intended?

Postby D.Bouchier » Tue Oct 19, 2010 11:19 am

Ok, I cannot seem to reproduce this, then probably something else was the problem, something I fixed earlier.

Sorry for the inconvenience.

ps. just delete this thread then...