Published:2011/8/12 1:40:00 Author:Li xiao na From:SeekIC
By Peter Moreton
Uploading the demo firmware using IC-Prog
Download the Elektor PIC18Flash demonstration firmware, file number 040010-11.zip from the Free Downloads page and unpack the zip file to a suitable folder.
Connect a short parallel cable between the PC printer port and the PIC18Fiash MTSP port K4, run IC-Prog and select File, Open File, PIC18flash.hex. Now click Command, Program All to upload the demo firmware. At the end of the program / verify sequence, the PIC CPU will start to run, and will begin to cycle through a sequence of hardware subsystem tests. Each test is depicted on the LCD display and are:
1. LCD display test. Data is displayed on the LCD display.
2. Speaker test. A sequence of audio tones is generated.
3. LED test. The on-board LEDs are illuminated in sequence.
4. DC Load test. i2-V DC loads connected to JPXX and JPXX are energized.
5. H-Bridge test. 12-V DC motors connected to K5 are spun in forward and reverse directions,
6. RS232 comms test. Data is emitted from the RS232 port. K3. at a baudrate of 9600.8,N.l and this data can be viewed by connecting the port to a PC COM port and using Hyperterminal or similar to display the data stream.
7. Real Time Clock (RTC) test. Tests the 32-kHz crystal timebase and runs forever. Hours and Minutes can be incremented using the pushbuttons.
Compiling the demo firmware using MPLAB/C18
The demo firmware is written in ’C and designed to be used as a basis for custom application development. Since it provides a template showing how each of the PIC18Flash subsystems can be manipulated from the ’C environment.
You should download and install the latest releases of MPLAB and C18demo from the web. and from within MPLAB, select Project, Open. PIC18flash.mcp. ’C source code can now be edited and then compiled by hitting F10 and the resultant HEX file uploaded to the PIC 18Flash system.
Using an RS232 bootloader
There are three ways to load firmware into PICl8Flash:
1. MTSP using the parallel port:
2. ICD-2 using the RJ-11 port:
3. RS232 bootloader.
The MTSP method provides a low-cost method of bootstrapping code into the uC. whereas the ICD-2 approach requires an expensive external debugger. but — on the positive side — enables firmware to be debugged in real time within MPLAB.
An RS232 bootloader is a small ’stub’ program that is initially flashed into the microcontroller by a traditional programmer. At power-up it communicates with a PC through the serial interface in order to erase and program the microcontroller’s flash memory. If no PC client communication is detected, the bootloader passes control to the main firmware application on the uC.
The RS232 bootloader method requires only a Windows COM port and enables firmware upgrades to be easily applied to products ’in the field’. To take advantage of this programming method, the user must first use MTSP or ICD-2 to initially flash the bootloader code. Once the bootloader is in place. you can use a PC bootloader client to upload your PIC ".hex firmware.
There are many freeware bootloaders available on the Internet, and we have tested several suited to use With the PIC18F, including the Tiny Bootloader which is included in the support zip file, and is described in the inset.
Reprinted Url Of This Article: http://www.seekic.com/blog/project_solutions/2011/08/12/PIC18Flash_development_Board__Continuing_where_the'16_series_left_off__(3).html
Print this Page | Comments | Reading(267)
Author:Ecco Reading(30190)
Author:Ecco Reading(3461)
Author:Ecco Reading(3181)
Author:Ecco Reading(3662)
Author:Ecco Reading(5231)
Author:Ecco Reading(3248)
Author:Ecco Reading(3390)
Author:Ecco Reading(3530)
Author:Ecco Reading(3935)
Author:Ecco Reading(3707)
Author:Ecco Reading(3677)
Author:Ecco Reading(3714)
Author:Ecco Reading(6028)
Author:Ecco Reading(3692)
Author:Ecco Reading(4478)