examples/gene_SYNC_HCS12/readme.txt
author Christian Taedcke <hacking@taedcke.com>
Tue, 08 Nov 2011 09:52:40 +0000
changeset 688 514108c6e4c4
parent 61 813ffdfbffb2
permissions -rw-r--r--
Win32 IXXAT::
CHANGED: - removed newline from log messages

pdo.c:
FIXED: - fixed two wrong MSG_ERR calls
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
Generator of Canopen SYNC message (cobid = 0x80)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
---------------------------------------------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
francis.dupin@inrets.fr
54
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
     4
27 Janv 2005. 
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
     5
Revised 13 Dec 2006
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
54
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
     8
Status of the code :
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
     9
====================
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    10
Tested with 
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    11
- CanFestival 3 rc2 (cvs version)
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    12
- gcc port for HC12 release 3.1
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    13
- Microcontroler MC9S12DP256 
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    14
on board  T-board (http://www.elektronikladen.de)
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
54
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    16
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    17
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    18
To build the example
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    19
--------------------
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    20
a) Compile CanFestival for hcs12 :
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    21
  Go to the root of CanFestival and enter
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    22
  ./configure --target=hcs12
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    23
  make clean all
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    24
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    25
b) Build the example
57
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    26
54
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    27
 cd examples/gene_SYNC_HCS12
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    28
 make clean all
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    29
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    30
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    31
What does the node ?
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    32
====================
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    33
Just reset it, it should send the SYNC (cobId 0x80) every 10 ms
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    34
Informations availables if you connect the serial port 0 to a terminal configured at 38400 8N1
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    35
				   
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    36
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    37
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    38
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    39
57
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    40
The node default values :
54
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    41
nodeId = 0x03
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    42
CAN rate = 250 kbps
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    43
Please read appli.c, these values can be modified by switch.
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    44
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    45
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    46
If you put the node in operational state, the CAN messages received are filtered : Only the NMT and Nodeguard can be received.
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    47
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.
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    48
57
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    49
Read the file objdict.c to see the capabilities of the node.
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    50
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    51
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    52
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    53
To change the period of SYNC,
61
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    54
-----------------------------
57
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    55
In pre-operational mode, send the SDO message cobid | .... (all in hexa):
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    56
0x603 | 23 06 10 00 40 42 0F 00 
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    57
to have a SYNC generated every 1 second. The change is instantaneous.
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    58
(Assume that the nodeId is 3).
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
61
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    61
To read the name of the node
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    62
----------------------------
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    63
(Assume that the nodeId is 3).
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    64
You must use the segmented SDO protocole to make an upload from index
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    65
0x1008 subindex 0x00
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    66
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    67
c : client
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    68
s : server (geneSync)
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    69
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    70
Here is the dialog you must obtain.
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    71
c: 0x603 | 40 08 10 00 00 00 00 00
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    72
s: 0x583 | 41 08 10 00 0A 00 00 00
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    73
c: 0x603 | 60 00 00 00 00 00 00 00
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    74
s: 0x583 | 00 47 45 4E 45 5F 53 59
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    75
c: 0x603 | 70 00 00 00 00 00 00 00
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    76
s: 0x583 | 19 4E 43 00 00 00 00 00
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    77
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    78
In the server's frames, you should read GENE_SYNC. (yes ...)
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    79
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    80
If in the exchange you are not responding too faster (less than 3
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    81
seconds. See in config.h #define SDO_TIMEOUT_MS),
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    82
the nodes send a SDO abort :
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    83
0x583 | 08 08 10 00 00 00 04 05
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    84
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    85
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
54
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    89
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    90
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    91
a2ca09ac1523 Tested. OK on Canfestival 3 rc2
frdupin
parents: 0
diff changeset
    92
57
522ece4057d2 *** empty log message ***
frdupin
parents: 54
diff changeset
    93
61
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    94
813ffdfbffb2 some improvements
frdupin
parents: 57
diff changeset
    95