Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 4 months ago.
mbed NXP LPC1768 pins hardware/software names
(1) For the mBed NXP LPC178 module where can I find what every pin does and all its various modes that can be used for. (2) What are the software names for those pins (like all the multiple UART 0,1,2,3 RX TX) which pin are they associated with? (3) Where is information on how the software name for a port device xx is associated with a particular hardware pin yy. Thanks Len Spyker
2 Answers
11 years, 4 months ago.
I am not sure I understand all your questions correctly, but the user manual lists all pins and their connection: http://www.nxp.com/documents/user_manual/UM10360.pdf
Using the schematic or mbed source code you can crossreference it with the pin numbers of mbed, but other people did it before you. This is nice in a picture, but does only include the 'official' peripherals: http://mbed.org/users/synvox/notebook/lpc1768-pinout-with-labelled-mbed-pins/. This one includes all pin-functions: http://mbed.org/users/Lerche/notebook/lpc1768-pin-functions/.
11 years, 4 months ago.
Hello Thank you for the details of the actual ARM IC this will sure help later on when I design a new PCB.
However I have a 40 pin mBed LPC1768 development module. On the NXP 40 pin module diagram there are 3 UART section shown in yellow, some pins also have multiple capabilities The 3 UARTs go to the module pins 9-TX 10-RX pins 13-14 TX RX pins 27-28 TX RX.
I am looking for a cross reference for each of these hardware UARTs listed above to the matching names used in software .
The cloud compiler's software names for these UART devices: Names like UART_0 or SER_TX_2. What is the software name for the UART TX and RX attached to pins 9-10 ? The software name for the 2nd UART attached to pins 13-14 ? The software name for the 3rd UART attached to pins 27-28 ?
In which file are these enumerated?
Thanks in advance. Len
The specific UART names mapped to pins are found in the device specific peripheral apis: http://mbed.org/users/mbed_official/code/mbed-src/file/5fa2273de5db/vendor/NXP/LPC1768/hal/serial_api.c
Also in that neighbourhood, in the CMSIS directory, the complete list of definitions is (not mapped to pins, but by combinging that with earlier links you can figure most out): http://mbed.org/users/mbed_official/code/mbed-src/file/5fa2273de5db/vendor/NXP/LPC1768/cmsis/LPC17xx.h
posted by 27 Jul 2013Hello. Thank you for the efforts so far. So I am finally looking for the file that has the real items for "UARTName" in it. What is this files name and where is it located?
Comment directed to the mBed development environment developers:
I do embedded engineering (hardware/software C, C++/firmware) and I am determining wether or not the NXP mBed LPC1768 40 pin module can be used in a commercial demonstration and a small prototype run. The pure hardware side is trivial but on the mBed development environment side I still have an unanswered question on the UART or other device(s) software names. Where is that documented? If this documentation does not exist and I have to Sherlock Holmes for hours for each nut of normally available information it will be a total commercial disaster. Where is the substantial documentation to get full USB, Ethernet and Wi-Fi going in a couple of days? The little code snippets are useful but are NOT as substitute for decent documentation. Len
posted by 28 Jul 2013UARTName is defined here: http://mbed.org/users/mbed_official/code/mbed-src/file/5fa2273de5db/vendor/NXP/LPC1768/hal/PeripheralNames.h. But just assuming the numbers stayed the same would be easier.
But those names are only used in the internal mbed functions. If you want to use them, you don't need to know the peripheral numbers. If you don't want to use them, you can just combine the user manual + LPC17xx.h.
I am definately not part of the mbed team: I do wonder what it is exactly that you are searching for. For example the first picture and table I linked you already tells which UART number is connected to which pins, why for example do you need to know where UARTName is defined? But the entire idea is that for 99% of your requirements you do not need to know which UART number you are addressing, or which bit of the status register you need to read. You just use library/standard C++ functions.
In the case of USB for example there is also an imo quite extensive list of standard libraries and implementation examples here: http://mbed.org/handbook/USBDevice. (I assume you are interested in USB device, USB host is here http://mbed.org/handbook/USBHost), with documentation for the architecture and the full source code with Doxygen documentation.
If you want to make your own register-level implementation, then yes that isn't nearly enough. Then you need the user manual, and probably also some app-notes. But that will be the same also with boards from other manufacturers. In that case you are ignoring a major advantage of mbed: the standard libraries.
So can you explain what exactly it is you are looking for? For example why do you need to know where UARTName is defined?
Disclaimer: Just to be sure, considering your second part was aimed at mbed devs, I am not one, this is purely my personal thingie :)
posted by 28 Jul 2013Hello Thanks again, that looks like what I am looking for. I certainly have no desire to write any low level code. Done enough of that in my life. Using the library/standard C++ functions if I want to send a character to come out on the UART2 TX pins on the mBed LPC1769 module what is the exact syntax and argument? Where are these I/O hardware related function arguments documented? Regards Len
posted by 28 Jul 2013The handbook has a list of standard library functions: http://mbed.org/handbook/Homepage. Also in the compiler if you click on the mbed library you can get the documentation.
For the UART you need the Serial code: http://mbed.org/handbook/Serial. So you make a serial object connected to the RX/TX pins you want it on (and that are supported obviously). Then for Serial it doesn't list all options, since it inherits some functions and also supports standard C++ functions. But just sending a character is done with putc.
So in your case something like:
#include "mbed.h" Serial uart(p28, p27); //Pin 28 TX, pin 27 RX. int main() { uart.putc('A'); while(1); //Printf is also completely supported int i = 100; float f = 0.5; char h = 0x05; uart.printf("i = %d, f = %f, h = %02X\n", i, f, h); }