Hi Folks, Does anyone know where on earth Metrowerks have secreted the CAN peripheral header files for the 56F832x devices? I can find a header that has things like GPIO etc, but there seems to be nothing for things like the CAN module. Cheers, Rob |
|
56F8323 Header file
Started by ●February 15, 2004
Reply by ●February 15, 20042004-02-15
Hi Rob For the 568357, I found some stuff in IO_Map.h, where ArchIO is defined. Maybe the 56F8323 uses the same filename. You can't find it by right-clicking on ArchIO (or I couldn't), but Find In Files spots it. FC_PRPH is the FlexCAN part. <IO_Map.h snip> FC_PRPH FC; } ArchIO; I use it by going into IO_Map.h and creating a type "TypeFcPrph" from their FC_PRPH defintion (part of ArchIO), by inserting the word "TypeFcPrph": /****************************************** *** Peripheral FC *******************************************/ typedef struct TypeFcPrph { word Reserved0[995]; /* Reserved (unused) registers */ /*** FCMCR - FlexCAN Module Configuration Register; 0x0000F800 ***/ <etc etc etc> <snip> } FC_PRPH; Then I can create my own pointer (pMyFcRegs ) to the whole FlexCan register structure with all the IO_Map.h-defined field names: volatile struct TypeFcPrph *pMyFcRegs; pMyFcRegs = &(ArchIO.FC); I drag that into my Expressions window for convenience. Rick Corey -----Original Message----- From: [mailto:] Sent: Sunday, February 15, 2004 10:58 AM To: Subject: [motoroladsp] 56F8323 Header file Hi Folks, Does anyone know where on earth Metrowerks have secreted the CAN peripheral header files for the 56F832x devices? I can find a header that has things like GPIO etc, but there seems to be nothing for things like the CAN module. Cheers, Rob _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/motoroladsp More Groups: http://www.dsprelated.com/groups.php3 Yahoo! Groups Links |
Reply by ●February 16, 20042004-02-16
Hi Rob FWIW, I just happened to need to do the same thing for the "ITCN" Interrupt controller, which in their infinite wisdom they have named "INTC" to make it easier to find. Also, documentation for this is now only in the TechDataSheet, not the FamilyManual or PeriphUserMan. This is for the 568357, your mileage my vary. IO_Map.h: /****************************************** *** Peripheral INTC *******************************************/ typedef struct TypeITCN_Prph { <snip> } INTC_PRPH; volatile struct TypeITCN_Prph *pMyITCN_Regs; pMyITCN_Regs = &(ArchIO.INTC); Rick Corey -----Original Message----- From: Corey, Rick [mailto:] Sent: Sunday, February 15, 2004 4:59 PM To: '; Subject: RE: [motoroladsp] 56F8323 Header file Hi Rob For the 568357, I found some stuff in IO_Map.h, where ArchIO is defined. Maybe the 56F8323 uses the same filename. You can't find it by right-clicking on ArchIO (or I couldn't), but Find In Files spots it. FC_PRPH is the FlexCAN part. <IO_Map.h snip> FC_PRPH FC; } ArchIO; I use it by going into IO_Map.h and creating a type "TypeFcPrph" from their FC_PRPH defintion (part of ArchIO), by inserting the word "TypeFcPrph": /****************************************** *** Peripheral FC *******************************************/ typedef struct TypeFcPrph { word Reserved0[995]; /* Reserved (unused) registers */ /*** FCMCR - FlexCAN Module Configuration Register; 0x0000F800 ***/ <etc etc etc> <snip> } FC_PRPH; Then I can create my own pointer (pMyFcRegs ) to the whole FlexCan register structure with all the IO_Map.h-defined field names: volatile struct TypeFcPrph *pMyFcRegs; pMyFcRegs = &(ArchIO.FC); I drag that into my Expressions window for convenience. Rick Corey -----Original Message----- From: [mailto:] Sent: Sunday, February 15, 2004 10:58 AM To: Subject: [motoroladsp] 56F8323 Header file Hi Folks, Does anyone know where on earth Metrowerks have secreted the CAN peripheral header files for the 56F832x devices? I can find a header that has things like GPIO etc, but there seems to be nothing for things like the CAN module. Cheers, Rob _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/motoroladsp More Groups: http://www.dsprelated.com/groups.php3 Yahoo! Groups Links _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/motoroladsp More Groups: http://www.dsprelated.com/groups.php3 Yahoo! Groups Links |
|
Reply by ●February 22, 20042004-02-22
Hi folks, Has anyone managed to successfully get the CAN module running? I have the 56F8300DEMO board and have initialised it as bellow. I have the bus clock running at 60MHz and I think I've set the CAN bus speed to be 1M. It is quite possible that I have set up the registers properly, but the TI 3V3 CAN transceiver that's driving the bus is at fault. The signals coming out of the chip are *not* the same level. Has anyone tried getting the CAN going on the demo board? It's trying to communicate with the 56F807 demo board whose CAN transceiver chip runs at 5V. According the datasheet of the device on the 56F8323 demo board, even though it's a 3.3V chip, it should still work happily with 5V devices. Cheers, Rob void InitCAN(void) { GPIO_C_PER |= 0x0C; // Enable the peripheral pins for CANRx and Tx FCMCR |= 0x200; // Put us in to soft reset asm(nop); asm(nop); while ((FCMCR & 0x100) == 0); // Then wait for the FREEZ_ACK bit to go high to indicate we're in soft reset temp = FCMCR; FCMAXMB = 15; // Setting up for a maximum number of message buffers - maybe need much less?! FCRXGMASK_L = 0xFFFE; // This is a global mask register - just set to check each acceptance register bit FCRXGMASK_H = 0xFFEF; // This is the high byte - not both FFFF as there are some unused bits FCRX14MASK_L = 0xFFFE; // This is pretty much the same as the global mask setting, but for buffer 14 FCRX14MASK_H = 0xFFEF; // This is the high byte FCRX15MASK_L = 0xFFFE; // And for buffer 15 FCRX15MASK_H = 0xFFEF; // This is the high byte FCIMASK1 = 0; // For the moment, disable all CAN interrupts FCSTATUS = 0; // Make sure all flags are off to start with /* Set up the values to be written to set the CAN bus speed. Values in brackets are the actual values written to the registers as the value is REGVAL+1 because they are generally divide by values and you can't divide by zero! ;-) In the case of PROP SEG it's because you can't have a prop seg of zero */ FCCTL0 = 1; // Just setting prop seg to be 2 (1) here FCCTL1 = 0x3A4; // (Hopefully) the right values for 1MHz FCMCR &= ~0x4000; // Take us out of CAN soft reset by clearing the halt bit FCMCR &= ~0x1000; // Take us out of CAN soft reset by clearing the halt bit } |
|
Reply by ●February 24, 20042004-02-24
Hi Folks, Just got my hands on a second 8323 demo board to see if see if I can sort out a CAN transceiver issue and after having programmed it a couple of times, it's not just giving me a flash programming error. It says: CCS Protocol Plugin : Error occurred while programming flash. Does this mean I just have to throw the board away, or is there maybe a flash erase function I could try? Cheers, Rob |