Writing c code for custom board of LPC uC

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

Writing c code for custom board of LPC uC

3,108 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neeleshgarg on Sat Mar 14 10:43:05 MST 2015
Hi, Neelesh Garg here,

I am a designing a custom board for LPC uC. Can LPCXpresso be used to directly write c code for this uC? Can a hex file be generated directly for the uC? Also how to do programming of this uC directly via LPCXpresso in the simplest manner without need to purchase something (like developer kit).
0 Kudos
Reply
13 Replies

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by 1234567890 on Thu Mar 19 09:52:59 MST 2015

Quote: neeleshgarg
Where Can i find how to write the board library details.


http://www.lpcware.com/content/faq/how-do-i-port-lpcopen-new-baord
The FAQ section is pretty helpful.


Quote: neeleshgarg

Also, in the examples which mention standard names like OscRateIn, RTCOscRateIn, functions like delay, writeLCDReg, etc. Please tell me where I can get the consolidated list of syntax of these standard descriptions and help on their uasge. Thankyou.


If you use LPCXPresso, you can click left on function/declaration/variable or whatever and then click right and chose 'Open Declaration'.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Mar 19 07:47:46 MST 2015
Working with LPC1788 without debugger is nonsense  ;-)

Yes, he can use FlashMagic to flash the program, but how is he writing / testing it without debugger  :quest:
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bilgehanparay on Thu Mar 19 07:34:13 MST 2015
Hi;

Yes you can.

You just need to buy  3.3V Uart to USB converter. My lpc chip's io was 3.3 Volts. (LPC812)
You can use LPCxpresso with Flash Magic. Just attach UART TX to Serial cable RX, UART RX to Serial Cable TX and GND to GND.


there is a awesome tutorial you can tune into. The example project they post also generates hex file, I copied their post-build commands to do that :D You can upload this hex file to Flash Magic.
https://learn.adafruit.com/getting-started-with-the-lpc810/programming-the-lpc810-with-flash-magic
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neeleshgarg on Tue Mar 17 11:23:07 MST 2015
Thankyou for the info.

Where Can i find how to write the board library details. I am unable to find in LPPCOpen. Are you talking about html help package on LPCOpen? Will i find the details on board library in that?
Also, in the examples which mention standard names like OscRateIn, RTCOscRateIn, functions like delay, writeLCDReg, etc. Please tell me where I can get the consolidated list of syntax of these standard descriptions and help on their uasge. Thankyou.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 17 10:20:56 MST 2015

Quote:
Yes, i have found the LPCOpen examples as said by you.I am currently wishing to download a port LED blink code to LPC1788 via UART using Flashmagic DIRECTLY. I don't have a Devkit or linkdebugger. Can I use the LPCOpen examples on my custom board directly?



You can, but you need to write a board library, as described in the LPCOpen docs.

However, you are really going to want to get yourself a debug probe. Trying to write any software without a debugger is 'challenging'. An LPC-Link2 debug probe costs $15 - it will save you that in a couple of hours a fruitless debugging without a debugger.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neeleshgarg on Tue Mar 17 10:17:03 MST 2015
Thankyou, LPCXpresso-support, for your prompt reply.

Yes, i have found the LPCOpen examples as said by you.I am currently wishing to download a port LED blink code to LPC1788 via UART using Flashmagic DIRECTLY. I don't have a Devkit or linkdebugger. Can I use the LPCOpen examples on my custom board directly?
Thankyou.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 17 09:57:00 MST 2015
You should use LPCOpen:
http://www.lpcware.com/lpcopen

There are LPCOpen examples provided in the Examples\LPCOpen directory of LPCXpresso. The User Guide describes how to Import projects to get started.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neeleshgarg on Tue Mar 17 09:44:28 MST 2015
Hi all,
I wish to use LPC1788 as an initial starting point. I recently activated free edition Of LPCXpresso on my offline PC. Now, the problem i am facing is that I am not understanding how to start writing c code on LPCXpresso. How to know which include files must be present, what is the syntax of writing port registers, interrupt routines, registers, etc. I have slight knowledge writing c code for megaAVR on Codevision. Please suggest a way to get started with writing basic c codes using LPCXpresso and user manual of LPC178x.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Mon Mar 16 05:13:08 MST 2015
If you want to use the UART for programming the µC then don't forget a level shifter like max3222 or similar.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Sat Mar 14 13:46:00 MST 2015
Hi Nliesh,
Please select microcontroller of your need from
http://www.nxp.com/products/microcontrollers/

Below line card may be helpful in selection
http://www.nxp.com/documents/line_card/75017609.pdf

As mentioned by R2D2, after that you can use User Manual of that particular microcontroller to explore more detailed information.
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Mar 14 13:01:05 MST 2015

Quote: neeleshgarg
What connections will be required  for UART programming via PC.



RXD and TXD  :)


Quote: neeleshgarg
What are the requirements for programming using USB bootloader.



Fist of all, USB  :O


Quote: neeleshgarg
What Special things(like drivers, bootloader software, and connections) are required?



Everything your User Manual  is describing  :)



0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neeleshgarg on Sat Mar 14 11:50:14 MST 2015
Thankyou R2D2, for your prompt reply.

What connections will be required  for UART programming via PC.

What are the requirements for programming using USB bootloader. What Special things(like drivers, bootloader software, and connections) are required?
0 Kudos
Reply

3,057 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Mar 14 11:28:18 MST 2015

Quote: neeleshgarg
Can LPCXpresso be used to directly write c code for this uC?



If LPCXpresso is supporting this uC, yes  :)



Quote: neeleshgarg
Can a hex file be generated directly for the uC?



If LPCXpresso is supporting this uC, yes  :)


Quote: neeleshgarg
Also how to do programming of this uC directly via LPCXpresso in the simplest manner without need to purchase something (like developer kit).



Use UART bootloader of your chip (and FlashMagic) or USB bootloader or CAN bootloader :)

BTW: It's very useful to buy a LPC-Link2  :)  So you can flash / debug your uC and learn how it works  :O 

http://www.embeddedartists.com/products/lpcxpresso/lpclink2.php

And don't forget a SWD connector at your board  ;-)
0 Kudos
Reply