Main Menu

lpc932 failure

Started by raghavendra, July 26, 2004, 08:02:08 AM

Previous topic - Next topic

raghavendra

Dear people,
    I am using Flash Magic Ver: 1.98(DLL Ver 1.67) for programming my P89LPC932. In my device, the following letters are typed: P89LPC932B, CC4877, Tu0404G. When I programmed using Flash Magic using break detect method I was able to do 5-6 times. After that, the device is not going to ISP mode at all.What may be the problem? I am not using any reset circuit .

Please help in this regard,
 
Thanking you,
Raghavendra
India.

Andy Ayre

Does your code still execute? Did you change anything to your code between tests, or is it the exact same code that you have been using? If you changed your code them it might be possible that you somehow stopped the initialization of the break detect from being executed.

Did you turn on the watchdog?

Embedded Systems Academy, Inc.
support at esacademy dot com

raghavendra

Dear Andrew Ayre ,
   Thanks for your prompt response. I had changed my code but I had cut and paste my uart init portion and so its not the problem. but with the help of CRO I found that controller is not executing the program (as also the LCD is not coming ON with the init message, which otherwise mustcome. In Flash magic the message indicates that the program is downloaded successfully.

We have lost 3 controllers in a very similar manner. It works for 3 - 4 times (reprogramming) and then it stops.

One observation (checked on the non-programming parts only, i have not checked with a good LPC) is that the TXD is low on the LPC and hence would be high on RS232 - like an always break condition. Will this have an adverse effect - like writing / erasing the lpc etc?

Kindly advice.

Thanks & regards.

raghavendra

Dear Andrew Ayre ,
   Thanks for your prompt response. I had changed my code but I had cut and paste my uart init portion and so its not the problem. but with the help of CRO I found that controller is not executing the program (as also the LCD is not coming ON with the init message, which otherwise mustcome. In Flash magic the message indicates that the program is downloaded successfully.

We have lost 3 controllers in a very similar manner. It works for 3 - 4 times (reprogramming) and then it stops.

One observation (checked on the non-programming parts only, i have not checked with a good LPC) is that the TXD is low on the LPC and hence would be high on RS232 - like an always break condition. Will this have an adverse effect - like writing / erasing the lpc etc?

Kindly advice.

Thanks & regards,
Raghavendra


Andy Ayre

It could be possible that the hex file did not correctly program. Have you checked for glitches, ripple on VCC and GND to the device? Have you decoupled the power supply?

What happens if you try to program the device using Flash Magic and the hardware entry method? Or does your hardware not support that functionality? If not then do you have a Keil MCB900 that you could put the device into a try it?

Embedded Systems Academy, Inc.
support at esacademy dot com

raghavendra

Dear Andrew Ayre ,
Thanks for suggestions. actually I forgot to erase the flash before programming. So, during pulse entry, I got the ISP mode.
 I have another problem now. I initialized I2C as below. I am not getting the clock in SCL. I am not sure if it should come only during transaction or always after init. Please reply.
Thanks,
Raghav

raghavendra

Dear Andrew Ayre ,
Thanks for suggestions. actually I forgot to erase the flash before programming. So, during pulse entry, I got the ISP mode.
 I have another problem now. I initialized I2C as below. I am not getting the clock in SCL. I am not sure if it should come only during transaction or always after init. Please reply.
Thanks,
Raghav


void init_I2C(void)
{
   
   /*set I2C pins to open-drain*/
   P1M1|=0x0C;
   P1M2|=0x0C;   
   
   I2CON = 0x44;
   
   I2SCLH = 0x19
   I2SCLL = 0x19;/* as 50% duty cycle*/
   
   I2ADR = 0x26;/* default slave address */

   EA=1; /* enable all interrupts*/
   EI2C=1;/*IEN1.0 BIT: enable I2C interrupt*/   
   
}

Andy Ayre

My suggestion would be to look at the code generated by Code Architect for the I2C and compare it to yours. If you want you can use the I2C library generated by Code Architect. Go to:

  www.codearchitect.org/philips

Embedded Systems Academy, Inc.
support at esacademy dot com

erikm

>>I initialized I2C as below. I am not getting the clock in SCL. I am not sure if it should come only during transaction or always after init<<
1) wrong forum for that question
2) only during transactions

Erik

raghavendra

Thanks for the suggestions.

I have a suggestion for flash magic. We went into a loop as:

1. We didn't realise that the flash does not get erased automatically when we try to re-program.
2. That the flash actually can be overwritten (reminds me of the old EPROMS) is something that was not realised / informed.

Hence:

1. The flash magic will select the erase blocks used by hex file by default.
2. The flash magic does not allow for progamming without any of the erase options not being erased.( may be unnecessary during first time programming, but does not harm!)
3. Provides for the CRC checking automatically and displays as pop-up the results for both device and hex files. Additionally may also warn of discrepancies if any.

I am aware that Flash Magic is fully free software and appreciate that the same is very good.

Thanks & Regards.

Andy Ayre

If you attempt to program without selecting any of the erase options - no checkboxes checked or blockes selected in section 2 - when you click on start, it should come up with a warning asking you if you are sure. Did it not do that? Can you give it a try again and see?

Making one setting a default to help some people, may make usage more awkward for others. Often people program more than one hex file, and therefore don't always want to erase before programming.

Flash can always be overwritten, but the bits can only be programmed to one state. For example, if the Flash erase state is FFH, then you can program each bit to 0, but not back to 1. So you could write AAH followed by 55H and the location will contain 00H after the two writes.

Thanks for the suggestion regarding the CRC. We'll add it to the list.

Embedded Systems Academy, Inc.
support at esacademy dot com

GORAN IGIC

Andy,
You mentioned watchdog issue.
What is work around to have break detect entering into ISP and still have WD enabled.
Thank you,
Goran

Andy Ayre

The ISP entry method doesn't make a difference - it is the bootloader that cannot work with the watchdog enabled, because it doesn't feed the watchdog. The only workarounds are:

1. Turn off the watchdog in the device configuration (UCFG1).

2. Use of the LPC9xx devices with a bootloader that can work with the watchdog enabled.

Embedded Systems Academy, Inc.
support at esacademy dot com