| Electronic Components Datasheet Search |
|
AN247 Datasheet(PDF) 11 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN247 Datasheet(HTML) 11 Page - Microchip Technology |
|
11 / 32 page ![]() 2003 Microchip Technology Inc. DS00247A-page 11 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 Property Sets the bit rate of the comm port. CommPort Property Specifies the comm port. MaxTimeOut Property Specifies the maximum wait (in milliseconds) for data to be received in the computer’s serial buffer. MaxRetrys Property Specifies the maximum number of times to resend a serial packet. SetFilter Method Sets a CAN filter on the interface. SetMask Method Sets a CAN mask on the interface. GetMsg Method Gets the message from the CAN receive buffer. PutMsg Method Puts the message in the CAN transmit buffer. SetBitRate Method Sets the CAN bit rate. Init Method Initializes the CAN module on the interface. IsGetMsgRdy Method Determines if the receive buffer has data. IsPutMsgRdy Method Determines if the transmit buffer is open. GoOnBus Method Puts the interface on the CAN bus. GoOffBus Method Takes the interface off the CAN bus. GetStat Method Gets the current status of the interface CAN module. OpenComm Method Opens serial communications to the interface CloseComm Method Closes communications to the CAN interface. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |