View Single Post
  #12   Spotlight this post!  
Unread 01-22-2010, 03:01 PM
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Exclamation Bug in Luminary Micro's Code

EDIT!!!!: OK, I talked with Joe Hershberger about this issue. Apparently they decided to stick with the code and change the Documentation. I guess the document has not been updated yet. I will keep this posted just in case anyone finds this error as well. So to repeat, the can_proto.h code is correct and should match the FIRST version of the Jag firmware.

woodk,

I might know why your current control is not working... At the section starting at line 119 in can_proto.h there appears to be a bug. If you refer to pages 21 and 22 of the "RDK-BDC Firmware Development Package User's Guide" they have a table of which bits to use for the API Classes. There are six bits that are assigned for telling the Jag which mode to operate in. The voltage and speed mode bit masks are correct, but the rest are off by one bit. Anyway, this is the code starting at line 119.

#define CAN_API_MC_VOLTAGE 0x00000000
#define CAN_API_MC_SPD 0x00000400
#define CAN_API_MC_POS 0x00000c00
#define CAN_API_MC_ICTRL 0x00001000
#define CAN_API_MC_STATUS 0x00001400
#define CAN_API_MC_CFG 0x00001c00
#define CAN_API_MC_ACK 0x00002000

What I believe to be the correct code is below:

#define CAN_API_MC_VOLTAGE 0x00000000
#define CAN_API_MC_SPD 0x00000400
#define CAN_API_MC_POS 0x00000800
#define CAN_API_MC_ICTRL 0x00000C00
#define CAN_API_MC_STATUS 0x00001000
#define CAN_API_MC_CFG 0x00001400
#define CAN_API_MC_ACK 0x00001800

Try this and see if your current control works. Bits, bits everywhere...

- Bryce

P.S. THANKS JOE!
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.

Last edited by Bryscus : 01-22-2010 at 03:35 PM.
Reply With Quote