Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] LPC2106 programming

Status
Not open for further replies.

jayanthyk192

Full Member level 3
Full Member level 3
Joined
Sep 17, 2010
Messages
179
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Visit site
Activity points
2,580
Hi,

I am building a circuit to program an LPC2106 MC. I got this MC from an old circuit which was still working. I made these connections:

>all four Vss to ground
>both Vdd to 3.3V
>one Vcore to 1.8
>reset pulled up with 4.7k
>Xtal to 11.0592 crystal
>TX,RX to serial port using max3232

With these connections,I tried to see if the device would be detected. I even had the P0.14 held to ground. But nothing happened.Then I used the serial port and sent a few characters and i got some other characters back and this happened only when i reset it. I did all the connections to the board myself, so is there a possibility that the device is dead or does it have some kind of code security? I used LPC2000 Flash utility to check this. Please help
 

Hi again,

I got a few changes, now the MC is giving SYNCHRONIZED serial if i send a character. From the datasheet i got to know that is being sent by the MC. I'm still trying, if anyone knows this please help
 

Hi jayanthyk,
I attach for you some good working schematic (checked in my projects) for LPC2106,
use this to check your connections...
 

Attachments

  • LPC2106.jpg
    LPC2106.jpg
    640.5 KB · Views: 111

Hi jayanthyk,
I attach for you some good working schematic (checked in my projects) for LPC2106,
use this to check your connections...
I checked my circuit and its pretty much the same except for a few
Pins, which are absent in my MC
 

Most NXP LPC series ARMs offer a bootloader in ROM which provides In System Programming (ISP) through the devices serial port or USB if available.

There are several utilities which ease the programming task using ISP:

Flash Magic



However, if Code Read Protection (CRP) Level 3 has been invoked, the device is effectively locked from ISP or JTAG Read, Write or Erasure, permanently disabling any future attempts to reprogram or read the contents of the flash rendering the device useless other than for its original purpose.

The only method of disabling CRP3 is through an existing routine already programmed into Flash before CRP3 was invoked.

Reference:UM10275 LPC2104/2105/2106 User Manual, Section:Table 194. Code Read Protection options, Page:232
CRP3 0x43218765
Access to chip via the JTAG pins is disabled. ISP entry by pulling P0.14
LOW is disabled if a valid user code is present in Flash sector 0.
This mode effectively disables ISP override using P0.14 pin. It is up to
the user’s application to provide need Flash update mechanism using
IAP calls if necessary.


Caution: If CRP3 is selected, no future factory testing can be
performed on the device.

Commercial products containing an LPC series ARM may invoke CRP3 before the releasing the product to prevent theft or alteration of the devices firmware.

Some devices are programmed to include a routine within the firmware for revoking CRP3 and allowing upgrading of the firmware, some do not.



BigDog
 

Most NXP LPC series ARMs offer a bootloader in ROM which provides In System Programming (ISP) through the devices serial port or USB if available.

There are several utilities which ease the programming task using ISP:

Flash Magic



However, if Code Read Protection (CRP) Level 3 has been invoked, the device is effectively locked from ISP or JTAG Read, Write or Erasure, permanently disabling any future attempts to reprogram or read the contents of the flash rendering the device useless other than for its original purpose.

The only method of disabling CRP3 is through an existing routine already programmed into Flash before CRP3 was invoked.

Reference:UM10275 LPC2104/2105/2106 User Manual, Section:Table 194. Code Read Protection options, Page:232


Commercial products containing an LPC series ARM may invoke CRP3 before the releasing the product to prevent theft or alteration of the devices firmware.

Some devices are programmed to include a routine within the firmware for revoking CRP3 and allowing upgrading of the firmware, some do not.



BigDog

Thank you for that. But if it were protected, then would I still get a "Synchronized" reply when i sent a "?". as per the datasheet this some sort of bootloader startup protocol. In the serial window if I send a "?" I get this:

??Synchronized
d

But after this i don't know how to send a string back. I'm supposed to send the same string back. So, is it the problem with security or any other?
 

My reply was an attempt to alert you of the possibility of CRP3 having been invoked.

You mentioned manipulating P0.14 had no effect, if this were the case then CRP3 could certainly be the source of the issue.

While you should be able issue ISP commands using a terminal emulation program, the easiest method of determining whether or not CRP3 has been invoked is simply to use Flash Magic and attempt to erase the device.

It could also determine if you can initialize the ISP bootloader.

Assuming of course, your ultimate goal is programming the device for other tasks.

BigDog
 

Post your circuit. Is your MCU and PC have same baud rates?

i set the baud rate to 9600, but it shouldn't matter since this is still in programming and as i learned the autobaud does this. also,LPC2106_l.jpg please see the attached schematic.

- - - Updated - - -

My reply was an attempt to alert you of the possibility of CRP3 having been invoked.

You mentioned manipulating P0.14 had no effect, if this were the case then CRP3 could certainly be the source of the issue.

While you should be able issue ISP commands using a terminal emulation program, the easiest method of determining whether or not CRP3 has been invoked is simply to use Flash Magic and attempt to erase the device.

It could also determine if you can initialize the ISP bootloader.

Assuming of course, your ultimate goal is programming the device for other tasks.

BigDog

I actually had the P0.14 shorted to ground and tried the terminal. With P0.14 set to 3.3V, the terminal did not respond, it only echoed. And i tried erasing the device, but everytime i tried the software just went blank and i had to force stop. (I think the timeout period is more).
 

If I remember correctly...

After the device indicates it has synchronized type an uppercase U, the device should echo back an uppercase U.

If it does not echo the uppercase U it is an indication there is an issue with either the device configuration, the RS-232 transceiver or cabling.

Ensure you have echoing disabled in the terminal emulation program.

BigDog
 

If I remember correctly...

After the device indicates it has synchronized type an uppercase U, the device should echo back an uppercase U.

If it does not echo the uppercase U it is an indication there is an issue with either the device configuration, the RS-232 transceiver or cabling.

Ensure you have echoing disabled in the terminal emulation program.

BigDog

I did what you said. After I got the Synchronized i sent back a "U". but i got back a "t" and another time a "d". One more thing i found is that the cable i'm using is pretty long and unshielded. But I tried the Rs232(using MAX3232) with a 5V atmega and it worked fine. And when i send "?" i get this:

Synchronized
d

is the "d" in the next line supposed to come or is it some sort of glitch? I tried even the 2400 bauad, but the same thing happened.
 

The spurious characters maybe due to noise or an improper/poor connection at the LPCs side, it's difficult to say.

At least it appears you've managed to invoke the ISP bootloader, although there still seem to be an issue with the connection reliability.

According to the LPC2106 User Manual, XON/XOFF flow control should be implemented.

It's been quite a while since I've typed ISP commands in by hand or use ISP at all for that matter as I have several JTAG programmer/debuggers I typically use.

I may have been incorrect concerning the uppercase U, try sending an uppercase J which should return the device part ID number.

Reference the LPC2106 User Manual, Section: 9. ISP commands, Page: 233, all the commands are listed along with the required format and successful replies.

BigDog
 

The spurious characters maybe due to noise or an improper/poor connection at the LPCs side, it's difficult to say.

At least it appears you've managed to invoke the ISP bootloader, although there still seem to be an issue with the connection reliability.

According to the LPC2106 User Manual, XON/XOFF flow control should be implemented.

It's been quite a while since I've typed ISP commands in by hand or use ISP at all for that matter as I have several JTAG programmer/debuggers I typically use.

I may have been incorrect concerning the uppercase U, try sending an uppercase J which should return the device part ID number.

Reference the LPC2106 User Manual, Section: 9. ISP commands, Page: 233, all the commands are listed along with the required format and successful replies.

BigDog

I tried "J", but i got some values which were not even close to the device ID. And everytime i sent a "j" I got a new value. Well, I suppose as you said the connection might be the problem. I'll rewire the serial port and then check again. Anyway, thanks a lot for helping me with this.

- - - Updated - - -

It worked!

I connected 5v rs232 from an atmega board and then used the terminal once again and it worked perfectly. Then i used the flash magic tool and everything was perfect. I just couldn't believe it worked. Thank you for the generous help big dog.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top