NXP/LPC - Detecting device type - Page 1
Forum section: electronics / general

author: JJalling
author_rank: Unknown
timestamp: August 04, 2021, 07:06:58 am
content: 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

author: nctnico
author_rank: Super Contributor
timestamp: August 04, 2021, 07:56:45 am
content: 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

author: Fred27
author_rank: Unknown
timestamp: August 04, 2021, 08:03:36 am
content: 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.

author: JJalling
author_rank: Unknown
timestamp: August 04, 2021, 08:07:11 am
content: Quote from: nctnico on August 04, 2021, 07:56:45 amThe part-id is the same for the two chips - only the package size/pin-count differ.BR Jonas

author: JJalling
author_rank: Unknown
timestamp: August 04, 2021, 08:08:25 am
content: Quote from: Fred27 on August 04, 2021, 08:03:36 amWell, 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

author: Fred27
author_rank: Unknown
timestamp: August 04, 2021, 08:38:37 am
content: Sorry - reading it again you did explain that clearly!

author: JJalling
author_rank: Unknown
timestamp: August 04, 2021, 08:44:26 am
content: Quote from: Fred27 on August 04, 2021, 08:38:37 amNo worries. I think that I'll stick with that solution for now and see if anything explodes.Thanks!BR Jonas

author: abyrvalg
author_rank: Frequent Contributor
timestamp: August 04, 2021, 03:16:19 pm
content: 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).

author: JJalling
author_rank: Unknown
timestamp: August 04, 2021, 06:43:02 pm
content: Quote from: abyrvalg on August 04, 2021, 03:16:19 pmI 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

author: nctnico
author_rank: Super Contributor
timestamp: August 04, 2021, 07:59:35 pm
content: Quote from: JJalling on August 04, 2021, 08:07:11 amBugger. 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.