etisserant@0: Generator of Canopen SYNC message (cobid = 0x80) etisserant@0: --------------------------------------------- etisserant@0: francis.dupin@inrets.fr frdupin@54: 27 Janv 2005. frdupin@54: Revised 13 Dec 2006 etisserant@0: etisserant@0: frdupin@54: Status of the code : frdupin@54: ==================== frdupin@54: Tested with frdupin@54: - CanFestival 3 rc2 (cvs version) frdupin@54: - gcc port for HC12 release 3.1 frdupin@54: - Microcontroler MC9S12DP256 frdupin@54: on board T-board (http://www.elektronikladen.de) etisserant@0: frdupin@54: frdupin@54: frdupin@54: To build the example frdupin@54: -------------------- frdupin@54: a) Compile CanFestival for hcs12 : frdupin@54: Go to the root of CanFestival and enter frdupin@54: ./configure --target=hcs12 frdupin@54: make clean all frdupin@54: frdupin@54: b) Build the example frdupin@57: frdupin@54: cd examples/gene_SYNC_HCS12 frdupin@54: make clean all frdupin@54: frdupin@54: frdupin@54: What does the node ? frdupin@54: ==================== frdupin@54: Just reset it, it should send the SYNC (cobId 0x80) every 10 ms frdupin@54: Informations availables if you connect the serial port 0 to a terminal configured at 38400 8N1 frdupin@54: frdupin@54: frdupin@54: frdupin@54: frdupin@54: frdupin@57: The node default values : frdupin@54: nodeId = 0x03 frdupin@54: CAN rate = 250 kbps frdupin@54: Please read appli.c, these values can be modified by switch. frdupin@54: frdupin@54: frdupin@54: If you put the node in operational state, the CAN messages received are filtered : Only the NMT and Nodeguard can be received. frdupin@54: The parameters of the filter are mapped in the object dictionary, so that the filter can be configured by SDO before entering in operational state. See the object dictionary index 2015 to 2023. To have the values applied, always download at 0x2023 index 0 the value 1 before entering in operational. frdupin@54: frdupin@57: Read the file objdict.c to see the capabilities of the node. frdupin@57: frdupin@57: frdupin@57: frdupin@57: To change the period of SYNC, frdupin@61: ----------------------------- frdupin@57: In pre-operational mode, send the SDO message cobid | .... (all in hexa): frdupin@57: 0x603 | 23 06 10 00 40 42 0F 00 frdupin@57: to have a SYNC generated every 1 second. The change is instantaneous. frdupin@57: (Assume that the nodeId is 3). etisserant@0: etisserant@0: frdupin@61: To read the name of the node frdupin@61: ---------------------------- frdupin@61: (Assume that the nodeId is 3). frdupin@61: You must use the segmented SDO protocole to make an upload from index frdupin@61: 0x1008 subindex 0x00 frdupin@61: frdupin@61: c : client frdupin@61: s : server (geneSync) frdupin@61: frdupin@61: Here is the dialog you must obtain. frdupin@61: c: 0x603 | 40 08 10 00 00 00 00 00 frdupin@61: s: 0x583 | 41 08 10 00 0A 00 00 00 frdupin@61: c: 0x603 | 60 00 00 00 00 00 00 00 frdupin@61: s: 0x583 | 00 47 45 4E 45 5F 53 59 frdupin@61: c: 0x603 | 70 00 00 00 00 00 00 00 frdupin@61: s: 0x583 | 19 4E 43 00 00 00 00 00 frdupin@61: frdupin@61: In the server's frames, you should read GENE_SYNC. (yes ...) frdupin@61: frdupin@61: If in the exchange you are not responding too faster (less than 3 frdupin@61: seconds. See in config.h #define SDO_TIMEOUT_MS), frdupin@61: the nodes send a SDO abort : frdupin@61: 0x583 | 08 08 10 00 00 00 04 05 frdupin@61: frdupin@61: etisserant@0: etisserant@0: etisserant@0: frdupin@54: frdupin@54: frdupin@54: frdupin@54: frdupin@57: frdupin@61: frdupin@61: