PIC18F252 Programming




1. Introduction

This investigation was started after I ordered the free sample kit for the Circuit Cellar contest, called Mad Dash for Flash Cash. There seems to be many ways to program the device. Here I have investigated two ways of programming the PIC18F252.

PIC18F252 Programming2. In-Circuit Serial Programming™

The Microchip document Programming the PIC18FXX2/FXX8, describes programming either the high or the low voltage In-Circuit Serial Programming™ (ICSP™). This document, 39576a.pdf, is available from the Microchip web site.

Data is clocked with a 10MHz clock maximum, into the PIC, in multiple 20 bit instructions, made up of 4 bits of command, and 16 bits of operand. Between each command and operand is a gap of 20ns and between each block of 20 bits is a gap of 20ns. The operand can contain the word of data payload to be programmed. This might mean the PIC18F252 could be programmed in about 33ms, but it is doubtful that a parallel port on a PC could support that throughput.

PIC18F252 Programming Schematic3. Serial Port Bootloader

Further investigation into the contents of a “blank”, as shipped, PIC18F252 revealed a program residing from 0000 – 01BF. This code is a serial port bootloader and if allowance for this code is made, then the device can be programmed via a COM port on a PC. The listing for the code is here. I disassembled the object code after reading the PIC18F252 with my PICstart®Plus development system, and comparing the code with that shown in AN851, A FLASH Bootloader for the PIC16 & PIC18. To handle the PIC18F252, the PICstart®Plus needed to be upgraded from 1v5 to 3v0 firmware after obtaining a PIC17C44 from the local supplier.

 

 

For more detail: PIC18F252 Programming

 




Current Project / Post can also be found using:

  • PIC18F252

Leave a Comment

*
= 5 + 0

Read previous post:
Getting Started with MPLAB XC8 Compiler – LED Blinking

In this tutorial we will learn How to Blink an LED with PIC Microcontroller using MPAB XC8 Compiler. Recently Microchip...

Close
Scroll to top