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

 


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.