Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Using the Colt bootloader in Lab #6 instead of the Jolt bootloader 
 
In Lab #6, you are asked to change the configuration bit setting for the PIC18 oscillator 
circuit from HSPLL mode (high-speed, PLL enabled) to the HS mode (high-speed, PLL 
disabled). This reduces the internal clock frequency by a factor of 4 (when the PLL is 
enabled, it multiples the crystal frequency by 4). You are asked to compare PIC18 current 
measurements with the PLL enabled and with it disabled. 
 
You are given explicit instructions on how to accomplish this using the Jolt bootloader. 
However, some students have had problems installing Jolt. You can use the Colt 
bootloader instead (see http://mdubuc.freeshell.org/Colt for the colt download and how to 
install it). This is much easier to install than Jolt as it does not require Java. 
 
The instructions below tell you how to use Colt to change the configuration bit settings.  
If you have Windows 2000, Colt may not work on your system; I have found no 
problems with using Colt under Windows XP. 
 
First when using Colt for programming hex files into the PIC18, the ‘Program Config’ 
option should NEVER be checked if you are using hex files have been produced the 
PICC18 compiler. Colt (and Jolt also) reads these configuration bits incorrectly from the 
file causing the bootloader on the PIC18 to become non-operational (you would have to 
get the TA to reprogram your PIC with the bootloader firmware). When the TA programs 
your PIC18 with the bootloader firmware the configuation bits are also set and these are 
never changed in any lab except Lab #6. However, lab #6 wants you to change the 
configuration bits on the PIC18 as discussed above – this can be safely done using Colt 
by following the steps below. 
 
To change the configuration bit settings using Colt: 
 
a. Compile reset.c with the PICC18 C-compiler and produce the reset.hex file. 
 
b. In MPLAB, use file->import to import the reset.hex file into memory. 
 
c. Open program memory, and verify that memory location 0x200 onwards contains valid 
instructions (and not NOPS) indicating that you have imported the file correctly. 
 
d. Chose Configure->Configuration_bits and change the "Oscillator mode" from HS-PLL 
Enabled to HS. 
 
e. Use File->Export  and write the a new hex file as reset_hs.hex. The default options for 
the export operation are fine. 
 
f. Load the file reset_hs.hex into Colt. Have the options 'Program Config' and 'Reload 
before program' checked.   Have 'program EEPROM Data' and 'reset after program' 
unchecked.   Then click the 'Program' button to program device.  This is the ONLY safe 
time to program configuration bits using Colt - is by using a HEX file that was written by 
MPLAB, not by the HI-TECH PICC compiler. You will get a COMMUNICATION 
TIMEOUT error by Colt after it programs the configuration bits. This is normal, exit 
Colt, and cycle power to PIC in order for the new configuration bits to take effect. 
 
Also, if you using a Hyperterm connection to the PIC, then you will have to change the 
baud rate to one-fourth what you were previously using for talking to it (if previously 
using 19200 change to 4800 as the internal PIC clock is now running at one-fourth the 
frequency). 
 
After you finish this portion of the lab, you will need to RESET your configurations bit 
BACK to HS-PLL.  Follow the steps above, except ensure that that the oscillator mode is 
set to "HS-PLL enabled" before writing the new hex file from MPLAB  – call this hex 
file reset_hspll.hex. Then use Colt to program the configuration bits as before. You 
should now be able to use Hyperterminal at a baud rate of 19200 to talk to the PIC18 
when it is running the reset.c program.  If you still have to use a baud rate of 4800, then 
you did not set the oscillator configuration bit setting back to HSPLL mode – you have 
somehow missed a step in reprogramming the configuration bits.