starting with LPC1102

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

starting with LPC1102

690 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ronikeshet on Mon May 09 09:51:42 MST 2011
Hi,
I'm a beginer with the LPC family.
I would like to run the "blinky" project on the LPC1102 mcu.
From the original "blink" project, I only changed the MCU settings to LPC1102, and the led port settings to port 1_1, re-compiled, and preformed a download (released mode) to my target board.
My target board has no external clock source, and the XTALIN is grounded.
There was no activity on port 1_1.
What did I do wrong ?
Is there another place where I should change in the project for this new MCU ?
The download procedure goes OK, but the software does not run.

I already did the followings:
1) Re-compiled
2) Changed the "SYSPLLCLKSEL" register to IRC mode (internal RC), (it's value was changed to 0)
3) Perform external reset
4) power supply is 3.3V

Please help me with this,
Thanks a lot,
Roni

[FONT=Arial][SIZE=1][COLOR=#231f20][FONT=Arial][SIZE=1][COLOR=#231f20]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
0 Kudos
10 Replies

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Mon May 23 13:34:15 MST 2011
Systick example for LPC1102- with software ISP

It is a good idea to start with this example when developing code for the LPC1102 to ensure that an ISP mechanism is implemented. There is no dedicated ISP pin on the LPC1102, so an ISP trigger must be implemented in software.

-NXP
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Mon May 16 09:37:55 MST 2011
LPC1102 blinky code with software-retriggerable ISP on pin P1.6. This should help avoid the situation where bad PLL settings are programmed in to the LPC1102 and it cannot be reprogrammed again.

-NXP
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Tue May 10 20:26:28 MST 2011
Hello ronikeshet and Zero,

On the LPC1102, there is no room for a dedicated hardware pin for ISP so a software "backdoor" should be left in the code. The "backdoor" is nothing more than a check for a specific pin to be pulled low that triggers launch of ISP mode. This is described in this application note:
http://ics.nxp.com/support/documents/microcontrollers/pdf/an11015.pdf

The main difference between the standard blinky and the LPC1102 blinky is that the LPC1102 blinky program includes this ISP backdoor and it also changes the default clock from the crystal to the IRC since the LPC1102 board does not have a crystal. There are two places this needs to be changed in the code- in system_LPC11xx.c both SYSOSCCTRL and SYSPLLCLKSEL.

We are going to have to ensure that LPCXpresso includes a blinky example project just for the LPC1102 and also post it here.
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue May 10 02:50:22 MST 2011
If you've programmed a non valid clock/PLL setting you have to switch to ISP mode.
In this mode you can access (reprogram) your chip again.

See:

http://support.code-red-tech.com/CodeRedWiki/DebugAccessChip
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ronikeshet on Tue May 10 02:44:09 MST 2011
Thank you very much Mr. Zero.
I wil check this out.
Now I have another problem. I was playing around with the clock & PLL settings, and now each time I try to download the software, the follwing error comes out:

******************************************
02: Faild on connect: Em(02). MEM-AP is not selected.
******************************************

I tried to reverse the clock settings, re-compile and re-download, but the same error again.
I hope I did not do an irreverasible setting, so the only solution for this would be to replace the chip.
I can drive an external clock at any frequency is required to correct this, with pulse generator.
It there any way to fix this ?
Please help me out, while I knock my head on the wall...
Thank you,
Roni
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue May 10 02:34:13 MST 2011
You described that you've changed the LED GPIO. If you use a pin it's necessary to check it's (default) function. So if you don't add something like[INDENT]  LPC_IOCON->R_PIO1_1 = 0x91;
[/INDENT]PIO1_1  will not work as GPIO (See UM10429 Table 53). It's default function is TDO (=JTAG) and if you don't change this function, you'll never see your program output something :)
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ronikeshet on Tue May 10 02:22:19 MST 2011
Thank you Mr. Zero,
As I said, I'm based on the blinky project, and did not add any change to port setting, I noly changed the led_port to 1, and the led_bit to 1, so I expect toggling on port 1_1.
For some reason, no activity on the port output (port direction is set as well)
Do you have any clue ?

Thank you,
roni
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue May 10 02:05:23 MST 2011
Did you use Peripherals View GPIO1->GPIO_DIR to check correct direction setting, GPIO1->GPIO_DATA to check (or to set) a signal?

And even more important, check in IOCON IOCON_R_PIO1_1 function. If it's set to TDO it will not work as GPIO1_1 :mad:
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ronikeshet on Mon May 09 23:54:40 MST 2011
Hi,
Yes, I can download and debug the software, but nothing comes out on the ports.
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon May 09 10:05:14 MST 2011
So you can download and debug  your program?
0 Kudos