PIC18Fx52 bootloader v1.5

PIC18Fx52 bootloader v1.5
Introduction - Background - Step-by-Step - Download - Source Code - Picture Gallery - Discussion Forum - Debugging - Troubleshooting - FAQ - Feedback


Introduction
This bootloader is compatible with the PIC18F252 and the PIC18F452, running at either 3.68Mhz, 10Mhz, 20Mhz or 40Mhz.

NOTE: Everything on this page is now free and open source (the previous charge was $50 for the source code).


Background

  • Severely battle tested over the last 4 months, with no problems.
  • Tested from -40 to +35 degrees celsius.
Step by Step
  1. Download windows software.
  2. Select your frequency - 3.68Mhz, or 20Mhz.
  3. Program this .hex kernel into the micro using a programmer such as the ICD2 from www.microchip.com (search for ICD2 fro the main page), P16PRO from www.picallw.com. A list of 3rd party programmers is available.
  4. Connect your PIC18Fx52 microcontroller to a spare serial port on your PC such as COM1 or COM2. Follow the supplied circuit diagram.
  5. Select the .hex file by clicking on 'Select Hex File', match the options to the screenshot above, and reset your micro.
  6. The new program will be bootloaded into the micro.
  7. A sample .hex file is supplied that flashes a LED on RC0 at a visible 3Hz. Bootload this file into your micro for testing purposes. Download flashing RC0 tester file. (1k)..
Debugging
If the tick boxes 'SFR' and 'RAM and 'ERPROM' are ticked, adding the line ...
asm("call 0x7000"); //trigger the graphical output SFR, RAM and EEPROM
... to your program dumps the contents of the EEPROM and the Special Function Registers (SFR) into a window. The program halts at this point, and the micro has to be reset, but it is extremely useful for debugging.
A sample .hex file with this "call 0x7000" instruction is available to demonstrates this debugging capability. Download test hex file (3k).




Troubleshooting

Testing the Serial Port
If you have trouble getting the bootloader to work, test to see if the PC is communicating properly with the PIC18Fx52 micro, via the serial port.
  1. Download the appropriate .hex file for your 18Fx52 from the list below.

    Serial port tester .hex file for 18Fx52 micro and:
    • 3.68Mhz crystal. Download (3k).
    • 20Mhz crystal. Download (3k). 
  2. Program this .hex file into your PIC18Fx52 micro.
  3. Download a Windows terminal program, to look at the serial port. Terminal 1.9b is supplied. Download (463k).
  4. If the PIC is communicating properly with the PC, the Windows terminal program will display '[alive]' at 19.2kbaud, on COMx, every 2 seconds. Pressing a key displays the string [key pressed: X] where X is the key. This verifies that both TX and RX are working on the serial port.
  5. If the PIC18Fx52 is communicating properly with the PC via the serial port, the bootloader should also work with no problems.

Download
Binaries: Windows™ software and PIC18Fx52 .hex files.
Source: Windows™ software and PIC18Fx52 bootloader C code. Compiles with Hi-Tech C.
Prebuilt hex files: custom frequencies.
There is also a version for Linux (and possibly Mac) using Python.
Picture Gallery
The pictures below show the header that was made up for the 18F252 bootloader. As you can see in the picture, there is an 18F452 chip in the header.
The reset button is visible closest to the camera lens. The gold colored microphone jack on the rear of the board carries the RS232 signal (at TTL levels) to the board. The 2 way switch at the rear of the board allows selection of either the serial port in the target circuit, or the on-board serial port.

The RS232 signals (+13 volts and -13 volts) are converted to TTL signals (0 volts and +5 volts) inside the DB9 connector. This DB9 connector goes straight into the gold colored microphone jack plug shown in the two pictures above. The reverse of the connector board shown below is bare of components.


FAQ
Frequently asked questions
Q. How about the source code in C ?
A. Yes, the source code is available; see the download page.

Q. Can you do a .hex file for X Mhz? (insert a random number at X)
A. In addition to the free bootloader which supports 3.68Mhz and 20Mhz, additional hex files are available for 10Mhz and 40Mhz. As you have the source, you should be able to compile it for any frequency you require.

Q. What are the recommended config bits?

A. Load up the supplied .hex file - the recommended bits are recognized automatically by the programmer.

Q. How much space does the bootloader take up?
A. The bootloader takes up the top 2kbyte out of 32kbyte of code space in a PIC18Fx52, from 0x7000 to 0x7FFF. For Hi-Tech PICC18, add the command '-RESROM7000-7FFF' to reserve space for the bootloader.

Q. Is there a version available for Linux using Python (and possibly Mac)?
A. Yes.


---start email---

Hi

It's a bit of a hack but here is a short python program which may be
useful for Linux enthusiasts.

This program works with the PIC18F452 boot-loader (20MHz clock version)
designed for the TRUTRACK boot-loader interface for Windows. I wanted to
use Linux, so I took a look at the serial data and hacked a quick script
to allow new code to be loaded using Linux instead of Windows.

It always loads a file called main.c and always assumes the port is at
/dev/ttyUSB0. The hex file is assumed to be a standard intel hex file
such as that produced by the HiTech PIC C compiler.  It also requires
PySerial and the USPP serial library. Otherwise it works quite well.
Just copy the desired hex file into the same directory as the python
program, open a terminal and type 'python pyloader.py' in the same
directory.

I haven't tried it but it should also work on a Mac as well....maybe
with a few tweaks.

- Chris Leaver

Download pyloader.py.

---end email ---

No comments:

Post a Comment

Labels

PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

Search More Posts

Followers