EmbeddedRelated.com

Ricky Bennett (@jorick)

Senior Embedded Software Engineer with over 40 years programming experience, 20 years at the embedded level. 10 years in the US Army as a meteorologist while slowly moving toward programming. Experience in communications, OCR, graphics, and device drivers. Wrote a complete GUI from scratch and named it Caramel. Why Caramel? Because it's GUI...

NXP LPC17xx/40xx: Decoding the Part ID

Ricky Bennett August 25, 20164 comments

This is the first blog of a number dealing with the NXP LPC17xx/40xx processor families and how to program them despite the lack of documentation.  The next blog will deal with implementing the LPC17xx/40xx UART with interrupts properly, and a subsequent blog will show how to use the UART in RS485 Normal Multidrop Mode (NMM) with Auto Address Detection (AAD).

My company has decided on using the NXP LPC17xx/40xx processor line for all our embedded projects.  Since...


Re: OT: Laughing in the Face of Adversity

Reply posted 5 years ago (04/10/2020)
Just think, if he died because he couldn't breathe, you could make a movie out of it.  "Fatal Attraction"...

Re: OT: Laughing in the Face of Adversity

Reply posted 5 years ago (04/09/2020)
Here's a meme I thought up.  I took this picture at my daughter's house:And I heard that you can make face masks out of coffee filters. I sewed two filters together...

Re: Trying to go live SOON

Reply posted 6 years ago (04/10/2019)
Ha ha!  I love it!  The smell detector is great!A suggestion for the next installment is to fix the lighting.  The background is very bright because of the sun...

Re: Preventing Forum Fatigue

Reply posted 6 years ago (01/21/2019)
I'm an 8051 programmer but I haven't done any 8051 stuff for a few years.  I welcome mik3ca's posts because they give me a chance to keep my 8051 skills sharp. ...
Or,      mov A,REMOTEUNIT ;unit that hit me (#1 to 24)      rl A             ;shift left      mov C,POS1       ;memory byte determined     ...
If you can guarantee that the count won't exceed 15 for either nybble, you can go with the following:      ;POS0 = bit 0 of sensor that got hit      ;POS1...

Re: 16-bit number to LCD digits

Reply posted 6 years ago (01/14/2019)
If you're just working with 16-bit numbers, you can eliminate the 1,000,000 and 100,000 from the table and drop down to two bytes.  You can also eliminate the 1...

Re: 16-bit number to LCD digits

Reply posted 6 years ago (01/14/2019)
You could try counting the number of times you can subtract 10000, 1000, 100, and 10 from the original number.  You'd need a table containing the values 10000,...
I can see only one place to save a couple of clock cycles.  In txdf, you can replace the sjmp notxe2 with mov PSW,SPSW; reti, saving the 2 clocks for the jump. ...

Re: Adding a percentage to a 16-bit number in 8051

Reply posted 6 years ago (12/07/2018)
I scraped the internet and found a discussion at http://www.8051projects.net/t9247/general-help-gui... where a zip file containing a number of 8051 math functions...

Re: RTOS Debugging - Tips, Tricks and Tools

Reply posted 7 years ago (05/09/2018)
If you have access to the RTOS source code, make sure you read it through and become familiar with the code and structures.  Inevitably, there will come a time...

Re: Compilers for Embedded Systems

Reply posted 7 years ago (03/23/2018)
Your comment about IAR being generally slow and crashing often really hits home.  We're currently frozen at EWARM (Embedded Workbench for ARM processors) version...

Re: Compilers for Embedded Systems

Reply posted 7 years ago (03/21/2018)
A few years back we transitioned from 8051 assembler to 32-bit ARM processors.  Since I had previous experience with IAR, I suggested that my company choose them,...
First, a definition of "volatile" is needed. A volatile variable is one that can change unexpectedly. Consequently, the compiler can make no assumptions about the...
A major problem with code is readability.  Here's an example using Booleans, but this could apply to many other areas.  Even the best coders with well commented...

Re: What is a Bootloader and when do you need one?

Reply posted 7 years ago (10/31/2017)
One important consideration for a boot loader is if it needs to update itself, not just the application.  If this is required, there are a number of ways to do...

Re: Building Automation Standards

Reply posted 7 years ago (09/28/2017)
There's "Embedded C Coding Standard" by Netrino (now the Barr Group), although I wouldn't consider it a standard like MISRA-C.  But it helps eliminate bugs by defining...
Proper documentation for the part is very important.  We use the NXP LPC1788 which is a great processor with lots of functionality, but the user manual for the...

Re: Multi-language support

Reply posted 7 years ago (09/05/2017)
Maybe your login session timed out?  I think that happened to me once.  I tend to not trust websites so I'll select and copy everything I wrote before clicking...

Re: Microcontroller books suggestions

Reply posted 7 years ago (08/23/2017)
I suggest you start with "Embedded C Coding Standard" by Michael Barr.  It's available in HTML or PDF for free here: https://barrgroup.com/Embedded-Systems/Books/Embed...It's...

Re: Counting clock cycles

Reply posted 8 years ago (04/17/2017)
There are various factors that can affect instruction timing.  Some are shown in the list below:Interrupts (the biggest offender)If interrupts are enabled, an interrupt...

Re: MCUs with hardware ids.

Reply posted 8 years ago (03/16/2017)
The NXP LPC17xx/40xx series processors have a unique 128-bit ID.  It's different on every processor chip.  I use it to generate a unique USB ID so that multiple...

Re: Changing BAUD rate on the fly for LPC2214

Reply posted 8 years ago (01/12/2017)
I've been there too.  I had a software engineer under me that put doubles in interrupts and even tried to do SPI transactions in an interrupt.  Fortunately he...

Re: Changing BAUD rate on the fly for LPC2214

Reply posted 8 years ago (01/12/2017)
Below is my code for setting the baud rate, which resides between the interrupt save-and-disable and enable code.  This is the (modified) output from my compiler...

Re: Changing BAUD rate on the fly for LPC2214

Reply posted 8 years ago (01/11/2017)
I'm not familiar with the LPC2214 but I do work with the LPC17xx/LPC40xx series so I'll give you my 2 cents based on that.  NXP likes to reuse functionality across...
I've looked over your code as well as the FatFs source code and I can't find anything that stands out.  So most likely there's a bug somewhere in the code you wrote...
I'm looking at the FatFs source code and f_close calls f_sync prior to actually closing the file.  So I can't see why it isn't working.  Could you post a code...
If FatFs worked and petit FatFs didn't, that may point to a bug of some sort in petit FatFs.  Can you use FatFs instead?  It has a small footprint as well, if...
"Global static"?  That doesn't make sense.  The variable can be either global (accessible by all modules) or static (accessible by the module it resides in).  It...
On the Petit FAT File System page (http://elm-chan.org/fsw/ff/pf/appnote.html) I see: "_FS_FAT16 is 1. _FS_FAT12, _FS_FAT32 and _USE_LCC are 0."  Since you're...

Re: LPC177x GPIO interrupt

Reply posted 8 years ago (10/05/2016)
The GPIO interrupts are shared with External Interrupt 3 (EINT3) in the LPC175x/6x family, but has its own interrupt in the LPC177x/8x family.  Perhaps the OP is...

Re: LPC177x GPIO interrupt

Reply posted 8 years ago (10/05/2016)
I have a complete LPC17xx/40xx library that I wrote, so I'm posting the links to the GPIO module.  You may find the information useful.  The module has the following...

Use this form to contact jorick

Before you can contact a member of the *Related Sites:

  • You must be logged in (register here)
  • You must confirm you email address