Author Topic: LPC11u24 Programming Circuit  (Read 5756 times)

0 Members and 1 Guest are viewing this topic.

Offline MattHollandsTopic starter

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
LPC11u24 Programming Circuit
« on: December 30, 2016, 10:44:37 pm »
I am working on a system that uses an LPC11u24 as its processor.  Previously I've always used Atmel 8 bit AVRs so this is my first foray into ARMs. However I can't really find much in the datasheet about programming - I think I just need the SWDIO and SWCLK pins and the RESET line but I'm not confident in that. I have messed around with the MBED platform, but that's a bit convoluted because it uses the MBED interface chip to program the device instead of using a SWD/JTAG programmer.

If anyone has experience with this chipset, could you please verify that I am doing the right thing here, specifically with the Cortex 10-pin connector and also with the USB interface!

Much appreciated!

Matt
« Last Edit: December 30, 2016, 10:51:11 pm by MattHollands »
Read about my stuff at: projects.matthollands.com
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30351
  • Country: nl
    • NCT Developments
Re: LPC11u24 Programming Circuit
« Reply #1 on: December 30, 2016, 10:55:09 pm »
I'd break out the serial port as well so you can fall back on serial port programming using a simple USB-UART board with DTR and CTS lines and the Flashmagic software. The flash section in the user manual tells you which pin needs to be held low for the bootloader to enter into serial programming mode.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12496
  • Country: us
    • Personal site
Re: LPC11u24 Programming Circuit
« Reply #2 on: December 30, 2016, 10:56:19 pm »
1. SWCLK had to be pulled up.
2. Your connector is really strange. On a standard connector pin 9 is GNDDetect and pin 7 is KEY (unused). And pin 8 is TDI, and SWO / TDO is pin 6.

Otherwise this looks OK.
Alex
 

Offline MattHollandsTopic starter

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: LPC11u24 Programming Circuit
« Reply #3 on: December 30, 2016, 11:08:35 pm »
1. SWCLK had to be pulled up.
2. Your connector is really strange. On a standard connector pin 9 is GNDDetect and pin 7 is KEY (unused). And pin 8 is TDI, and SWO / TDO is pin 6.

Otherwise this looks OK.

Regarding point 1, I've read a load of contradictory things on this. For example, on https://www.lpcware.com/content/forum/lpc1778-swd-swclk-pull-or-pull-down lpcxpresso-support says that a pull-down is recommended. It sort of looks like it doesn't matter if you use pull-up or down.

Regarding point 2.... Yeah I don't know what I've done there. I guess I can't count to 10.
Read about my stuff at: projects.matthollands.com
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12496
  • Country: us
    • Personal site
Re: LPC11u24 Programming Circuit
« Reply #4 on: December 30, 2016, 11:16:42 pm »
Regarding point 1, I've read a load of contradictory things on this.

Well, the only authoritative document on this is a user manual, and it says:
Quote
WCLK Input Serial Wire Clock. This pin is the clock for SWD debug logic when in the Serial Wire Debug mode (SWD). This pin is pulled up internally.

SWDIO Input / Output Serial wire debug data input/output. The SWDIO pin is used by an external debug tool to communicate with and control the LPC11U3x/2x/1x. This pin is pulled up internally.

Both pins are already pulled-up as this is the default bus state according to ARM. External pull-up resistors are used for improved EMI resistance, but are not strictly necessary.
Alex
 
The following users thanked this post: MattHollands

Offline MattHollandsTopic starter

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: LPC11u24 Programming Circuit
« Reply #5 on: December 30, 2016, 11:28:23 pm »
Well, the only authoritative document on this is a user manual, and it says

Fair enough. To be honest, I didn't realise there was a user manual - I had just been looking at the data sheet. I did think there was a lot of information missing.

I'd break out the serial port as well so you can fall back on serial port programming using a simple USB-UART board with DTR and CTS lines and the Flashmagic software. The flash section in the user manual tells you which pin needs to be held low for the bootloader to enter into serial programming mode.

Good idea. It seems like RX and TX etc can be multiplexed to multiple pins... does it matter which one I use?
Read about my stuff at: projects.matthollands.com
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12496
  • Country: us
    • Personal site
Re: LPC11u24 Programming Circuit
« Reply #6 on: December 30, 2016, 11:30:17 pm »
Good idea. It seems like RX and TX etc can be multiplexed to multiple pins... does it matter which one I use?
User Manual to the rescue:
Quote
If PIO0_3 is sampled HIGH, the bootloader connects the LPC1Uxx as a MSC USB
device to a PC host. The LPC11U3x/2x/1x flash memory space is represented as a
drive in the host’s operating system.
• If PIO0_3 is sampled LOW, the bootloader configures the UART serial port using pins
PIO0_18 and PIO0_19 for RXD and TXD and calls the ISP command handler.
:)

But read the whole section "20.2 Bootloader", it has a lot of relevant stuff.
Alex
 

Offline MattHollandsTopic starter

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: LPC11u24 Programming Circuit
« Reply #7 on: December 31, 2016, 12:05:07 am »
 :-DD Oh man. I need to get used to their datasheet layout. Thanks for your help!
Read about my stuff at: projects.matthollands.com
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12496
  • Country: us
    • Personal site
Re: LPC11u24 Programming Circuit
« Reply #8 on: December 31, 2016, 12:07:57 am »
:-DD Oh man. I need to get used to their datasheet layout. Thanks for your help!
With NXP I just skip the datasheet part and go straight to the UM. This is annoying, but noting you can do about it.

Atmel used to have full datasheets and summary datasheets. Same idea - one is useful, the other one is pointless. But they stopped doing that for new parts, and now there is only one document that has all the information.
Alex
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30351
  • Country: nl
    • NCT Developments
Re: LPC11u24 Programming Circuit
« Reply #9 on: December 31, 2016, 12:24:09 am »
:-DD Oh man. I need to get used to their datasheet layout. Thanks for your help!
With NXP I just skip the datasheet part and go straight to the UM. This is annoying, but noting you can do about it.
I disagree. The datasheet has the electrical specifications and the user manual has the functional specifications. Mixing those just makes things less clear. You'll need both though to get a NXP ARM controller up & running.

Nowadays many complex chips have seperate datasheets, user manuals and errata sheet so go through all these document to get a complete picture.
« Last Edit: December 31, 2016, 12:26:05 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4628
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: LPC11u24 Programming Circuit
« Reply #10 on: January 05, 2017, 08:33:25 am »
I'd break out the serial port as well so you can fall back on serial port programming using a simple USB-UART board with DTR and CTS lines and the Flashmagic software. The flash section in the user manual tells you which pin needs to be held low for the bootloader to enter into serial programming mode.
No need. This chip has USB MSC bootloader built-in.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->