In-Circuit Programming (Icp); Isp And Iap Capabilities Of The P89Lpc920/921/922 - Philips P89LPC920 User Manual

80c51 8-bit microcontroller with two-clock core
Table of Contents

Advertisement

Philips Semiconductors
FLASH MEMORY
#include <REG931.H>
unsigned char idata dbytes[64];
unsigned char Fm_stat;
bit PGM_USER (unsigned char, unsigned char);
bit prog_fail;
void main ()
{
prog_fail=PGM_USER(0x1F,0xC0);
}
bit PGM_USER (unsigned char page_hi, unsigned char page_lo)
{
#define LOAD
#define EP
unsigned char
FMCON = LOAD;
FMADRH = page_hi;
FMADRL = page_lo;
for
(i=0;i<64;i=i+1)
{
}
FMCON = EP;
Fm_stat = FMCON;
if ((Fm_stat & 0x0F)!=0) prog_fail=1; else prog_fail=0;
return(prog_fail);
}
Figure 15-3: C-language routine to erase/program all or part of a page

In-Circuit Programming (ICP)

In-Circuit Programming is a method intended to allow commercial programmers to program and erase these devices without
removing the microcontroller from the system. The In-Circuit Programming facility consists of a series of internal hardware
resources to facilitate remote programming of the P89LPC920/921/922 through a two-wire serial interface. Philips has made in-
circuit programming in an embedded application possible with a minimum of additional expense in components and circuit
board area. The ICP function uses five pins (Vdd, Vss, P0.5, P0.4, and RST). Only a small connector needs to be available to
interface your application to an external programmer in order to use this feature.

ISP and IAP capabilities of the P89LPC920/921/922

An In-Application Programming (IAP) interface is provided to allow the end user's application to erase and reprogram the user
code memory. In addition, erasing and reprogramming of user-programmable bytes including UCFG1, the Boot Status Bit, and
the Boot Vector is supported. As shipped from the factory, the upper 512 bytes of user code space contains a serial In-System
Programming (ISP) loader allowing for the device to be programmed in circuit through the serial port. This ISP boot loader will,
in turn, call low-level routines through the same common entry point that can be used by the end-user application.
2003 Dec 8
0x00
0x68
i;
//
//write my page address to addr regs
FMDATA = dbytes[i];
//erase & prog page command
// data buffer
// status result
// clear page register, enable loading
// erase & program page
// loop count
//load command, clears page reg
//read the result status
97
User's Manual - Preliminary -
P89LPC920/921/922

Advertisement

Table of Contents
loading

This manual is also suitable for:

P89lpc921P89lpc922

Table of Contents