EmbeddedRelated.com
Forums

SPI buses on LPC1768

Started by Olivier Gautherot January 19, 2011
Hello,

> No, I don't think so.
> ARM don't publish who licenses what in detail.
> When you read datasheets you can generally figure out the
> similarities between peripherals.

i have not followed this thread in detail nor spend a lot time
on reading last email, but there are some identification register
(in each peripheral ?) at least i think i have seen them on Cortex-M3,
but never used / accessed them.
Is there a way to recognize it through them ?
So you just need a small programm to read and decode
this info...

Best regards,

Martin

An Engineer's Guide to the LPC2100 Series

Hi,

> > No, I don't think so.
> > ARM don't publish who licenses what in detail.
> > When you read datasheets you can generally figure out the
> similarities
> > between peripherals.
>
> i have not followed this thread in detail nor spend a lot time on
> reading last email, but there are some identification register (in each
> peripheral ?) at least i think i have seen them on Cortex-M3, but never
> used / accessed them.
> Is there a way to recognize it through them ?
> So you just need a small programm to read and decode this info...

That's true for PrimeCell peripherals; and it's true for CoreSight
components. You can identify CoreSight components through the DAP using the
ROM table. Other peripherals may well not have IDs associated with them.
However, a look at the user manual for the chip usually tells you all you
need to know.

-- Paul.

Hello Paul,

Friday, January 21, 2011, 10:20:06 AM, you wrote:

PC> No, I don't think so. ARM don't publish who licenses what in detail. When
PC> you read datasheets you can generally figure out the similarities between
PC> peripherals.

You can also scan the register blocks for the PrimeCell IDs. All
standard PLxxx peripherals seem to have the PrimeCell ID (0xB105F00D)
at 0x0FF0 and peripheral ID at 0x0FE0. Here's a quick and dirty scanner that
seems to work on my LPC1768:
extern "C" void HardFault_Handler() { printf("Hard Fault!\n"); while(1); }

#define REG32(addr) *(volatile unsigned int*)(addr)
#define PCELL_ID_VAL 0xb105f00d

uint32_t readID(uint32_t addr)
{
union {
uint8_t bytes[4];
uint32_t word;
};
bytes[0] = REG32(addr);
bytes[1] = REG32(addr+4);
bytes[2] = REG32(addr+8);
bytes[3] = REG32(addr+12);
return word;
}

struct PeriphID_t
{
uint32_t PartNumber:12;
uint32_t Designer:8;
uint32_t Revision:4;
uint32_t Configuration:8;
};

void ScanBlock(uint32_t base)
{
printf("%08X: ", base);
uint32_t PCellID = readID(base + 0xFF0);
printf("%08X ", PCellID);
if ( PCellID != PCELL_ID_VAL )
{
printf("Not a PrimeCell peripheral!\n");
}
else
{
union {
PeriphID_t t;
uint32_t PeriphID;
};
PeriphID = readID(base + 0xFE0);
printf("Peripheral ID: %08X\n", PeriphID);
printf("PartNumber: 0x%03X, Designer ID: 0x%02X, Revision: %d, Configuration: 0x%02X\n",
t.PartNumber, t.Designer, t.Revision, t.Configuration);
}
}
40088000: B105F00D Peripheral ID: 00041022
PartNumber: 0x022, Designer ID: 0x41, Revision: 0, Configuration: 0x00

This is PL022 (SSP) from ARM (0x41='A').

--
WBR,
Igor mailto:s...@mail.ru

Hi Igor,

> PC> No, I don't think so. ARM don't publish who licenses what in
> PC> detail. When you read datasheets you can generally figure out the
> PC> similarities between peripherals.
>
> You can also scan the register blocks for the PrimeCell IDs. All
> standard PLxxx peripherals seem to have the PrimeCell ID (0xB105F00D)
> at 0x0FF0 and peripheral ID at 0x0FE0. Here's a quick and dirty scanner
> that seems to work on my LPC1768:

Indeed, but you can get this by just reading the manual. :-) You'll find
the CoreSight components can also be scanned, and not just on Cortex-M.
Some devices, such as the iMX51, are broken in this respect as the DAP
doesn't have the correct entry for the ROM table...

-- Paul.