Sign in

username:

password:



Not a member?

Search LPC900_users



Search tips

Subscribe to LPC900_users



Ads

Discussion Groups

Discussion Groups | LPC900 | Writing UCFG1 with IAP routines?

Find help, specifications and source code for the LPC900. The LPC900 challenges Microchip and AVR based on the worlds most popular 8-bit architecture the 80C51. With a 2-clock core the LPC900 series is a high performance, very flexible and low cost 8-bit microcontroller family. Designers using or interested in these devices are encouraged to share their know-how and ask questions.

Writing UCFG1 with IAP routines? - markvanelst - Jan 25 7:04:00 2006

Hello,

I am writing a bootloader for the P89LPC922. I use IAP lite to write
to the program memory and this works fine. I want to reprogram UCFG1
(RPE) before updating the firmware to prevent unwanted reset requests
during updating. How can I program UCFG1 with IAP?
I tried the IAP sources on www.esacademy.com, but they don't seem to
work :(
Can you help me with the esacademy sources or do you have another
solution? Thanks in advance for your help

Kind regards,
Mark





(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )


Re: Writing UCFG1 with IAP routines? - paul_seerden - Jan 25 12:18:00 2006

Hello Mark,

Before writing the UCFG1 register you have to give the CCP Clear
Configuration Protection command (see example below).

shift_out(WR_FMCON); // write to FMCON
shift_out(CCP); // write clear config protection
shift_out(WR_FMDATA); // write FMDATA command
shift_out(CLR_CCP_KEY); // write command
do // loop while status is busy
{
shift_out(RD_FMCON); // read FMCON command
read_data = shift_in(); // shift in data from FMCON
}
while(read_data & 0x80); // check for done status MSB

Regards,
Paul --- In lpc900_users@lpc9..., "markvanelst" <markvanelst@y...>
wrote:
>
> Hello,
>
> I am writing a bootloader for the P89LPC922. I use IAP lite to write
> to the program memory and this works fine. I want to reprogram UCFG1
> (RPE) before updating the firmware to prevent unwanted reset
requests
> during updating. How can I program UCFG1 with IAP?
> I tried the IAP sources on www.esacademy.com, but they don't seem to
> work :(
> Can you help me with the esacademy sources or do you have another
> solution? Thanks in advance for your help
>
> Kind regards,
> Mark





(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )

Re: Writing UCFG1 with IAP routines? - phb_miller - Jan 26 21:56:00 2006

Hi Mark,

I agree with Pauls comments and feel that you have protected the 
configuration values with the config protection bits in the BOOTSTAT 
register.

These are both active high ('1' is enabled) and their functionality 
is:
BootStat.7 DCCP - Disable Clear Config Protection
BootStat.6 CWP - Config Write Protect

You can use the CWP bit to protect the config area from inadvertant 
writes.

However, there is a gotchya that you need to be aware of.

If you have also set DCCP then the CCP command will only be sucessful 
in the ICP and parallel programming (if the device supports it) mode.

So, what value have you got in BootStat?

Phoebe

--- In lpc900_users@lpc9..., "paul_seerden" 
<paul_seerden@y...> wrote:
>
> Hello Mark,
> 
> Before writing the UCFG1 register you have to give the CCP Clear 
> Configuration Protection command (see example below).
> 
> shift_out(WR_FMCON);            // write to FMCON
> shift_out(CCP);                 // write clear config protection
> shift_out(WR_FMDATA);           // write FMDATA command
> shift_out(CLR_CCP_KEY);         // write command
> do                              // loop while status is busy
> {
>     shift_out(RD_FMCON);        // read FMCON command
>     read_data = shift_in();     // shift in data from FMCON
> }
> while(read_data & 0x80);        // check for done status MSB
> 
> Regards,
> Paul
> 
> 
> --- In lpc900_users@lpc9..., "markvanelst" 
<markvanelst@y...> 
> wrote:
> >
> > Hello,
> > 
> > I am writing a bootloader for the P89LPC922. I use IAP lite to 
write 
> > to the program memory and this works fine. I want to reprogram 
UCFG1 
> > (RPE) before updating the firmware to prevent unwanted reset 
> requests 
> > during updating. How can I program UCFG1 with IAP?
> > I tried the IAP sources on www.esacademy.com, but they don't seem 
to 
> > work :(
> > Can you help me with the esacademy sources or do you have another 
> > solution? Thanks in advance for your help
> > 
> > Kind regards,
> > Mark
> >
>
	


(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )