Author Topic: NXP/LPC - Detecting device type  (Read 472 times)

0 Members and 1 Guest are viewing this topic.

Offline JJalling

  • Supporter
  • ****
  • Posts: 238
  • Country: dk
NXP/LPC - Detecting device type
« on: August 04, 2021, 07:06:58 am »
Hello all,

I'm currently merging/stream-lining the firmware on two old products. For easier maintenance I want to use the same binary firmware for both products, since 99.9% of the code is the same anyway - just two different generations of the board.
They both use the same LPC1549 chip, but in different physical packages - one being a 48 pin package and the other a 100 pin package. This means that PIO-bank 1 and 2 are only available on physical pins on the 100 pin package.

I want the software to be able to detect what chip package it is and since it's probably the same die, there is not a register where I can simply read the difference - only the overall type.

My idea is to rely on the fact that (I assume) it's the same physical die, and that there is a strong pull-up connected to some of the pins on bank 1 and 2 on the board with the 100 pin package.
By enabling the internal pull-down resistors on these pins during startup, I can detect if it's one or the other, by reading the pin state (the external pull-ups are stronger than the internal ones).

Has anyone done anything like this before? It seems to work, but my only concern is that the pin registers in the 48 pin package are marked as reserved (which I guess they are) in the datasheet.

Thanks for your help,

BR Jonas
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 21557
  • Country: nl
    • NCT Developments
Re: NXP/LPC - Detecting device type
« Reply #1 on: August 04, 2021, 07:56:45 am »
You can read the part ID through the IAP API. There is a list somewhere with part IDs. The source code from this project is likely a good start to get a list: http://www.windscooting.com/softy/mxli.html#Latest
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Fred27

  • Supporter
  • ****
  • Posts: 688
  • Country: gb
    • Fred's blog
Re: NXP/LPC - Detecting device type
« Reply #2 on: August 04, 2021, 08:03:36 am »
If there's not anything in the IC that can help, is there a feature of your board than can identify one or the other? e.g. read one of the inputs that's only connected on the 100 pin device.
 

Offline JJalling

  • Supporter
  • ****
  • Posts: 238
  • Country: dk
Re: NXP/LPC - Detecting device type
« Reply #3 on: August 04, 2021, 08:07:11 am »
You can read the part ID through the IAP API. There is a list somewhere with part IDs. The source code from this project is likely a good start to get a list: http://www.windscooting.com/softy/mxli.html#Latest

The part-id is the same for the two chips - only the package size/pin-count differ.

BR Jonas
 

Offline JJalling

  • Supporter
  • ****
  • Posts: 238
  • Country: dk
Re: NXP/LPC - Detecting device type
« Reply #4 on: August 04, 2021, 08:08:25 am »
If there's not anything in the IC that can help, is there a feature of your board than can identify one or the other? e.g. read one of the inputs that's only connected on the 100 pin device.

Well, that was actually what (I tried to) explain in the first post. There are some pins on the 100 pin device that I can read and compare with the 48 pin device, after enabling the internal pull-down resistors on said pins.

BR Jonas
 

Offline Fred27

  • Supporter
  • ****
  • Posts: 688
  • Country: gb
    • Fred's blog
Re: NXP/LPC - Detecting device type
« Reply #5 on: August 04, 2021, 08:38:37 am »
Sorry - reading it again you did explain that clearly!
 
The following users thanked this post: JJalling

Offline JJalling

  • Supporter
  • ****
  • Posts: 238
  • Country: dk
Re: NXP/LPC - Detecting device type
« Reply #6 on: August 04, 2021, 08:44:26 am »
Sorry - reading it again you did explain that clearly!

No worries. I think that I'll stick with that solution for now and see if anything explodes.

Thanks!

BR Jonas
 

Online abyrvalg

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: ru
Re: NXP/LPC - Detecting device type
« Reply #7 on: August 04, 2021, 03:16:19 pm »
The fact that some i/o pad of the same die is not bonded out shouldn’t affect anything, it’s the same as unconnected pin. But if you want to stay 101% formal you can strap some pin existing on both packages differently on each board type (pull down on one, up on another).
 
The following users thanked this post: JJalling

Offline JJalling

  • Supporter
  • ****
  • Posts: 238
  • Country: dk
Re: NXP/LPC - Detecting device type
« Reply #8 on: August 04, 2021, 06:43:02 pm »
The fact that some i/o pad of the same die is not bonded out shouldn’t affect anything, it’s the same as unconnected pin. But if you want to stay 101% formal you can strap some pin existing on both packages differently on each board type (pull down on one, up on another).

I agree, but it's hard/expensive to change an old hw design with 10k-50k units in the field - it's easier/cheaper to do stuff in software.

Br Jonas
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 21557
  • Country: nl
    • NCT Developments
Re: NXP/LPC - Detecting device type
« Reply #9 on: August 04, 2021, 07:59:35 pm »
You can read the part ID through the IAP API. There is a list somewhere with part IDs. The source code from this project is likely a good start to get a list: http://www.windscooting.com/softy/mxli.html#Latest

The part-id is the same for the two chips - only the package size/pin-count differ.
Bugger. I thought they had different ones but looking at Flash magic it seems they used the same part ID indeed. In your case I'd also use existing pins with known states which aren't bonded out on the 48pin package.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: JJalling


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf