Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > Microcontrollers 8bit > PIC18f452 Progr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 855 of 862
Post > Topic >>

PIC18f452 Program Memory Problem

by GaryI <gary.ireland@[EMAIL PROTECTED] > Aug 18, 2008 at 04:58 AM

Hi,

I've got a bootloader for the pic18f - The following function is ok
for the pic18f8722 i'm using to write to prog memory.

//load the holding registers
for (counter = 0; counter < uBOOTDIn.BiFWLen; counter++)
{
*((BiADR.pAdr)+counter) = uBOOTDIn.BiFWData[counter];
}
//first we fill the required holding registers
StartWrite();
while(EECON1_WR); //Wait till WR bit is clear

Where, BiFWLen is the length of the data to write to - usually 16
bytes.  The 8722 has a holding reg of 64 bytes - so no problem.  But
the pic18f452 has a holding reg of only 8 bytes so any ideas?  I've
tried :

if (uBOOTDIn.BiFWLen>8)
{
//load the holding registers
for (counter = 0; counter < 8; counter++)
{
 *((BiADR.pAdr)+counter) = uBOOTDIn.BiFWData[counter];
}
//first we fill the required holding registers
StartWrite();
while(EECON1_WR); //Wait till WR bit is clear

for (counter = 8; counter < uBOOTDIn.BiFWLen; counter++)
{
 *((BiADR.pAdr)+counter) = uBOOTDIn.BiFWData[counter];
}
//first we fill the required holding registers
StartWrite();
while(EECON1_WR); //Wait till WR bit is clear
}

But the problem is that when i check the program memory - the data is
not written to the correct address locations only on the
pic18f452 ????  ?

This doesn't make sense - the issue only occurs on the 452 even with
data <=8 bytes.  Is there any errata issues/hardware problems related
to the 452 / program memory?

Any help or sample code greatly appreciated.

I've also seen http://ww1.microchip.com/downloads/en/DeviceDoc/80173c.pdf

Can someone explain section 6

Thanks
 




 1 Posts in Topic:
PIC18f452 Program Memory Problem
GaryI <gary.ireland@[E  2008-08-18 04:58:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 12:53:05 CST 2008.