p3p / pio-framework-arduino-lpc176x

10 stars 20 forks source link

LPC 1778 / 4078 208 pin package support #32

Closed InsanityAutomation closed 1 month ago

InsanityAutomation commented 4 years ago

Adds additional pins on all perf ports, adds perf port 5. First pass, no hardware in hand yet. Im sure I missed stuff. We need to review the valid_pins function.

Ive attached what im working with for now.

EBAB_Schematic.pdf

Roxy-3D commented 4 years ago

Surely there is a way to ask the processor for its revision information. If we can do that, we can dynamically adjust the LPC_GPIO_BASE to the correct place.

gmarsh commented 4 years ago

Suggestion: can the platformio.ini file pass in a -DLPC1768, -DLPC1778, -DLPC4078, etc... argument in the build_flags, that can in turn define the LPC_GPIO_BASE appropriately, as well as other chip-specific things that might be different?

I'd rather that accesses to GPIO registers be direct, vs based off a global pointer or (worse) a conditional flag, for speed reasons. Doing this means LPC_GPIO_BASE has to be known at compile time... plus, having it known at compile time vs making it dynamic means less code that has to change.

Right now, I'm hoping that these changes will support the following targets:

LPC1768 ('base' config) LPC1769 (120MHz vs 100MHz) LPC1778 (100MHz, LPC_GPIO_BASE different, support for 144 pin and 208 pin packages) LPC4078 (120MHz, LPC_GPIO_BASE different, support for 100/144/208 pin packages, M4F core)

As far as hardware goes... at the present time, I have one of my X6 boards with a 100-pin 4078 installed on it, that I'm using to figure out the bootloader. The first five EBAB prototypes are en-route from China and should be on my desk by Tuesday next week, provided COVID19 doesn't shag that up... these don't have processors installed on them yet, but I've got both LPC1778 and LPC4078's (in 208-pin packages) that I can install on them.

sjasonsmith commented 4 years ago

I am looking at replacing all the NXP files with newer versions which support the whole family of processors at compile time. I'm hoping I'll be able to work on it and get it compiling tonight.

I don't want to just hack in a change to that base address, because I don't know if that is the only meaningful change between the processors.