DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AN247 View Datasheet(PDF) - Microchip Technology

Part Name
Description
Manufacturer
AN247 Datasheet PDF : 32 Pages
First Prev 11 12 13 14 15 16 17 18 19 20 Next Last
AN247
APPENDIX A: A SIMPLE
PROGRAMMING
INTERFACE
To demonstrate the functionality of the CAN bootloader,
a simple serial-to-CAN interface is discussed briefly
here. The hardware, controller firmware and software
are designed to work as a package. Users are encour-
aged to use this design example as a starting point for
developing their own programming systems.
The Hardware
An underlying assumption of the bootloader is that
some method exists to introduce the new program data
to the target CAN network. There may be cases, how-
ever, where no provision has been made for a network
to communicate with an outside data source. In these
cases, it is necessary to introduce a CAN node whose
sole function is to provide an external data interface.
A schematic outline for the interface’s hardware is pre-
sented in Figure A-1 and Figure A-2 (following pages).
The heart of the design is a PIC18F458 microcontroller,
which runs the programming firmware and provides
both CAN and RS-232 communications. Interfaces to
the CAN bus and programming data source are pro-
vided by an external CAN transceiver and RS-232
interface.
Optional status LEDs, headers for accessing the con-
troller’s I/O ports and power regulation are provided in
the design. These may be modified, removed or
expanded upon as the system design requires.
The Firmware
The firmware is an extension of the PIC18F serial boot-
loader discussed in Microchip Application Note AN851,
“A FLASH Bootloader for PIC16 and PIC18 Devices”.
Two new commands (RD_SRAM and WT_SRAM) have
been added to provide access to SRAM, thus allowing
complete control of all the peripherals (including the
CAN module) through the serial bootloader.
A summary of the commands and syntax for the PIC18
FLASH Bootloader is provided in Appendix A of
Application Note AN851.
The Host Software
The software portion of the interface is designed to run
on IBM® compatible computers running Microsoft®
Windows®. It provides a simple graphic-based tool to
translate program files in Intel® HEX format into serial
data for the programmer firmware.
THE CANCOMM CONTROL
The software interface uses an ActiveX® control to pro-
vide simple communications with the CAN module
through the serial port. For those who wish to experi-
ment with the interface, a total of 4 properties and 13
methods are available to the user. These are listed in
Table A-1.
THE USER INTERFACE
A simple graphic and text interface allows the user to
keep track of the bootloading operations in real-time.
Examples of the interface’s dialogs are shown in
Figure A-3.
TABLE A-1: ActiveX METHODS USED BY THE HOST SOFTWARE
Method
Type
Purpose
BitRate
CommPort
MaxTimeOut
MaxRetrys
SetFilter
SetMask
GetMsg
PutMsg
SetBitRate
Init
IsGetMsgRdy
IsPutMsgRdy
GoOnBus
GoOffBus
GetStat
OpenComm
CloseComm
Property
Property
Property
Property
Method
Method
Method
Method
Method
Method
Method
Method
Method
Method
Method
Method
Method
Sets the bit rate of the comm port.
Specifies the comm port.
Specifies the maximum wait (in milliseconds) for data to be received in
the computer’s serial buffer.
Specifies the maximum number of times to resend a serial packet.
Sets a CAN filter on the interface.
Sets a CAN mask on the interface.
Gets the message from the CAN receive buffer.
Puts the message in the CAN transmit buffer.
Sets the CAN bit rate.
Initializes the CAN module on the interface.
Determines if the receive buffer has data.
Determines if the transmit buffer is open.
Puts the interface on the CAN bus.
Takes the interface off the CAN bus.
Gets the current status of the interface CAN module.
Opens serial communications to the interface
Closes communications to the CAN interface.
2003 Microchip Technology Inc.
DS00247A-page 11

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]