Sei sulla pagina 1di 5

rtfCANopen

Page 1 of 5

rtfCANopen Version 2.0 -An implementation of CANopen for Real Time systemsAsier Illaro (asier.ip@euskalnet.net) Javier Portillo (jtppobej@bi.ehu.es)

INDEX
> Software of rtfCANopen 2.0 > Download area

Software of rtfCANopen 2.0


rtfCANopen version 2 incorporates the possibility of updating the software that is executed on the microcontrollers over the CAN network. The software is built in three main modules: Updating module: This module handles the program process of the other two modules via the CAN network performing the CANopen standard. In order to provide this functionality, this module has to be allocated in memory. CANopen module: This module implements all the functions that are needed to make the node 100% CANopen compliant. This module can be updated and programmed via the CANopen network. Application module: This module handles the control of the devices that are connected to the node. This module can be updated and programmed via the CANopen network. The following figure shows the software structure.

http://www.disa.bi.ehu.es/gcis/spanish/proyectos/rtfCANopen/eng/rtfcanopen_2.htm

8/18/2011

rtfCANopen

Page 2 of 5

Updating Module

CANopen

Application

CAN BUS

Thick arrow: data flow Undulating arrow: interrupt Common arrow: module calls

The updating module is the same for all the nodes and provides CANopen compatibility in order to communicate and receive the code of the other modules via the CANopen network.

rtfCANopen 2.0 FEATURES


These are the core features of the new library: 1. Object Dictionary. This is the list of implemented Object Dictionary entries: Device type (1000h) Error register (1001h) Manufacturer device name (1008h) Manufacturer software version (100Ah) Download program data (1F50h) Program control (1F51h) 1F50h and 1F51h object dictionary entries add two news sub-indexes, this sub-indexes can each handle the download of CANopen and Application modules. The objects needed for the correct operation can be added in the CANopen module. These are the Object Dictionary entries that are implemented by default: 1st receive PDO parameter (1400h) 2nd receive PDO parameter (1401h) 1st receive PDO mapping (1600h) 2nd receive PDO mapping (1601h)

http://www.disa.bi.ehu.es/gcis/spanish/proyectos/rtfCANopen/eng/rtfcanopen_2.htm

8/18/2011

rtfCANopen

Page 3 of 5

1st transmit PDO parameter (1800h) 2nd transmit PDO parameter (1801h) 1st transmit PDO mapping (1A00h) 2nd transmit PDO mapping (1A01h) 2. 2 transmit PDO and 2 receive PDO are supported. The following parameters can be configured for each PDO: ID (11 bit). Transmission type (cyclic synchronous and acyclic synchronous). PDO mapping (8 objects at the most).

3. Switch configurable parameters: Node-ID (16 different ID) CAN bus speed (1000, 800, 500, 250, 125, 50, 20 and 10 Kbs) Microcontroller speed (4 or 8 MHz).

4. Resources that are used: Program memory (FLASH): 3Kword. Data memory (RAM): 70 bytes. EEPROM: 51 bytes.

5. New Application and CANopen modules can be downloaded to the microcontrollers via the CAN network. Microchips MPLAB IDE development environment generates INTEL HEX FORMAT which is used to download the code through the CAN network.

6. The response time to a SYNC object is 0,6 ms running at 8 MHz.

DESIGN OF UPDATING MODULE


The updating module is built in two main sub-modules. COMMUNICATION sub-module provides the CANopen services needed in order to receive new code via the CANopen network. FLASH sub-module handles Flash-programming functions that are needed to program the new code. The following figure shows these two sub-modules.

UPDATING MODULE COMMUNICATON

http://www.disa.bi.ehu.es/gcis/spanish/proyectos/rtfCANopen/eng/rtfcanopen_2.htm

8/18/2011

rtfCANopen

Page 4 of 5

COMMUNICATON FLASH
NMT
SDO

ISR

SPI

CAN BUS

COMMUNICATION This sub-module handles all the communication services needed to receive the code via the CANopen network. Accordingly, it is built in four sub-modules that provide these CANopen services. NMT: This sub-module implements the finite state machine that controls the operation of the node according to the CANopen standard. SDO: This sub-module handles SDO messages. These messages are used to send code via CANopen network as well as to configure the communication parameters of a node. ISR: This sub-module handles the CAN controller interrupts when a CAN message is received. In this case, ISR connects the interrupt with the appropriate sub-module, according to the message. SPI: This sub-module handles the access to the CAN controller and the access to the EEPROM memory. FLASH This module handles the Flash-programming functions needed to program CANopen and Application modules. It provides the functions that allow the transfer of the code received from RAM memory to FLASH memory. This process is shown in the following figure: RAM New CANopen CAN Bus FLASH Updating module

CPU
New Application CANopen Aplicacin

http://www.disa.bi.ehu.es/gcis/spanish/proyectos/rtfCANopen/eng/rtfcanopen_2.htm

8/18/2011

rtfCANopen

Page 5 of 5

UPDATING THE SOFTWARE OF THE NODE


The software of the nodes is built in three modules; the updating module is the same for all the nodes and will be allocated in program memory. The other two modules can be different for each node, depending on the devices that have to be controlled, these can be updated via the CAN network. In order to provide this functionality, an interface is required, a piece of software that implements the relations between the modules. This interface takes control of these sections: Entry points: Definitions of the entry points of the routines. Variables: Definitions of the global variables used in all modules. Memory addresses: Definitions of the memory locations. Specially, memory addresses of the entry points previously defined and data memory addresses of the global variables previously defined.

This interface is built in several template files that provide all the information needed to design and update the CANopen and Application modules correctly. This template files are built in several suitable files used in Microchips MPLAB IDE for the generation of the HEX format files that contain the programmable code of each module: CANopen.asm Aplikazioa.asm AppSarrerak.asm CANSarrerak.asm Aplikazioa.lkr CANopen.lkr > go to index

DOWNLOAD AREA
> rtfCANopen V2.zip (binaries and source codes) > interface (Template files) > go to index

http://www.disa.bi.ehu.es/gcis/spanish/proyectos/rtfCANopen/eng/rtfcanopen_2.htm

8/18/2011

Potrebbero piacerti anche