http://www.www.datasheet4u.com

900,000+ Datasheet PDF Search and Download

Datasheet4U offers most rated semiconductors datasheets pdf




  Microchip Technology Semiconductor Electronic Components Datasheet  

AN247 Datasheet

A CAN Bootloader

No Preview Available !

AN247 pdf
AN247
A CAN Bootloader for PIC18F CAN Microcontrollers
Author: Ross M. Fosler
Microchip Technology Inc.
The drawback to this is a lack of efficiency, as directly
manipulating the target memory and manually verifying
data takes significant time on the CAN bus.
INTRODUCTION
To make the operation more efficient, the programming
target could be given some intelligence, like self-
Among the many features built into Microchip’s
Enhanced FLASH Microcontroller devices is the capa-
bility of the program memory to self-program. This very
verification. This would make communications
unidirectional, essentially cutting the time on the CAN
bus in half.
useful feature has been deliberately included to give
Overall, the best savings is to design all the nodes in
the user the ability to perform bootloading operations.
the system with similar, modular firmware. Each node
Devices like the PIC18F458 are designed with a desig-
could then use only those modules required for its task,
nated “boot block”, a small section of protectable pro-
but the entire group of nodes could be updated simul-
gram memory allocated specifically for bootload
taneously. The sacrifice here is program memory over-
firmware.
head, since some nodes may have resident firmware
This application note demonstrates a simple boot-
that is not used.
loader implementation for the PIC18F families of micro-
controllers with a CAN module. The goals of this
Programming a Running System
implementation are to stress maximum performance
An interesting situation is bootloading in an active and
and functionality, while requiring a minimum of code
functioning system. In this instance, one or more of the
space. For users developing CAN enabled systems, it
nodes are taken off-line to update their firmware, yet
provides a low level framework that can be used withwww.DataSheet4U.com the functionality of the entire system is not completely
higher level network protocols to develop more
disabled. This, of course, requires that the target node
complex and custom-tailored systems.
or nodes have some functional independence from
CONSIDERATIONS FOR FIELD
PROGRAMMING OVER THE CAN BUS
other parts of the networked system.
There are priority issues to contend with when pro-
gramming in an active system. For example, what pri-
The combination of FLASH technology and robust net-
work communication capability in a single device
makes over-the-network programmability a very desir-
able option. However, this makes bootloading on a
CAN bus network a very different challenge from more
typical uses, such as using a bootloader to program a
single FLASH device in isolation. Let’s consider some
of the key issues in over-the-network programming.
ority can be given to the bootloader without affecting
the critical communications in the system? If higher pri-
ority is given to nodes running the bootloader than
other nodes running their normal application, then it
may take time for data to be received when data is
being streamed to the programming target. Thus, criti-
cal systems that require relatively low latency for data
transmission or reception may fail to function as
expected. In the opposite situation, assigning the pro-
Single or Group Programming
gramming target with a priority that is too low could lead
to extremely long programming times, simply because
Providing bootloading capability over a CAN bus net-
the programming source and target are continually
work takes some forethought. For example, a system
waiting for an IDLE bus to pass data.
with a number of nodes may have identical firmware in
several nodes. Since every node on a CAN bus can
see all passing data, it may be more efficient to
program these identical nodes in a single pass.
In an active network, planning is necessary to provide
sufficient bus time for programming. One solution is
simply to give relatively high priority to bootloader pro-
gramming operations, then design the programming
However, in other cases where a node or many nodes
source to “inject” time for other applications while
are unique, it may only be necessary to open
streaming data on the CAN bus. Thus, bus time is
peer-to-peer communications to program the device.
always available and controlled by the programming
This can be the simplest programming system,
source.
because the programming source could contain all the
intelligence and freely manipulate the target memory.
2003 Microchip Technology Inc.
DS00247A-page 1


  Microchip Technology Semiconductor Electronic Components Datasheet  

AN247 Datasheet

A CAN Bootloader

No Preview Available !

AN247 pdf
AN247
Even with careful planning, there may be situations
where safety is actually compromised as a result of bus
contention. In these cases, the best option may be to
put all nodes in the network into a “Configuration” mode
and shut down all system functions.
FIGURE 1:
RX TX
BOOTLOADER FUNCTIONAL
BLOCK DIAGRAM
Bootloader Firmware
Boot Mode Entry
Boot mode entry is determined by an event. This could
be a hardware event, such as pressing one or more
buttons after a device RESET. It could also be a net-
work event, such as a special set of data that tells a
device to enter Boot mode. One example is a network
boot ID that is mapped directly into the CAN ID. Then
the key, along with specific target information, could be
embedded in the data field of a CAN frame. The key
information could put one or more nodes into Boot
mode.
BOOTLOADER FIRMWARE
Basic Operation Overview
CAN
Module
Data
(Msg Identifier)
CONTROL/DATA
Control/Data Buffer
PUT/GET
FLASH
Program
Memory
EE Data
Memory
Configuration
Memory
D8
Bootloader
Control
Registers
D0
Memory I/O
Logic
An overview of the CAN bootloader’s operation is
shown in Figure 1. A CAN Message Identifier and data
is received through the CAN module. One bit in the
identifier is used to indicate whether to PUT or GET
data. Another is used to determine if the message is to
FIGURE 2:
PROGRAM MEMORY MAP OF
THE PIC18F458
be interpreted as data to be programmed or bootloader
control information. Writing data automatically invokes
the appropriate function to write to memory (FLASH,www.DataSheet4U.com
Data EEPROM, or Configuration Memory). Writing to
Boot Program
RESET Vector
0000h
0200h
the Control registers sets the operation of the
bootloader.
High Priority Interrupt Vector 0208h
The bootloader can be configured at build time to sup-
port one of two mutually exclusive modes of operation.
In P Mode (or Put-only) mode, the microcontroller only
accepts PUT commands, and never “talks back” to the
source. In PG Mode, both PUT and GET commands
are accepted, allowing the source to both read from
and write to the target’s memory.
Low Priority Interrupt Vector 0218h
A more detailed explanation is provided in subsequent
sections.
Memory Organization
PROGRAM MEMORY USAGE
Currently, PIC18F devices reserve the first 512 bytes of
Program Memory as the boot block. Future devices
may expand this, depending on application require-
ments for these devices. This bootloader is designed to
occupy the current designated boot block of 512 bytes
(or 256 words) of memory using the recommended
options. Note, however, some compile time options can
grow the bootloader beyond the boot block. Figure 2
shows a memory map of the PIC18F458. The boot
area can be code protected to prevent accidental
overwriting of the boot program.
Program Memory
7FFFh
Note: Memory areas not shown to scale.
DS00247A-page 2
2003 Microchip Technology Inc.


Part Number AN247
Description A CAN Bootloader
Maker MicroChip
Total Page 30 Pages
PDF Download
AN247 pdf
Download PDF File


Buy Electronic Components




Related Datasheet

1 AN240 Interfacing 3V and 5V Applications Philips
Philips
AN240 pdf
2 AN2407 Reed Solomon Encoder/Decoder on the StarCore SC140/SC1400 Cores Freescale Semiconductor
Freescale Semiconductor
AN2407 pdf
3 AN240P TV Sound IF Amplifier / FM Detector Circuits National Semiconductor
National Semiconductor
AN240P pdf
4 AN241 Thermal Considerations Philips
Philips
AN241 pdf
5 AN241P TV Sound IF Amplifier / FM Detector Circuits National Semiconductor
National Semiconductor
AN241P pdf
6 AN2458 Color Encoder IC NTSC/PAL for CCD Video Camera Panasonic Semiconductor
Panasonic Semiconductor
AN2458 pdf
7 AN2458SH Color Encoder IC NTSC/PAL for CCD Video Camera Panasonic Semiconductor
Panasonic Semiconductor
AN2458SH pdf
8 AN246 Transmission lines and terminations with Philips Advanced Logic families NXP
NXP
AN246 pdf
9 AN247 Reficed EMI Techniques Philips
Philips
AN247 pdf






Part Number Start With

0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O    P    Q    R    S    T    U    V    W    X    Y    Z

site map

webmaste! click here

contact us

Buy Components