We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Using a keil mcb2300 with lpc2378.
Used the NXP example bundle uart code as the base and attempting to modify it to use all four uarts via interrupts. Couldn't find any examples that use all four uarts on lpc2300.
zip of base project www.alexthegeek.com/.../testUsarti.zip code www.alexthegeek.com/.../
The uart init routines run and print out their message on uart0. uart0 and uart1 work and echo back characters when initalised in order 0,1,2,3 but not uart2 and 3.
Most likely I'm doing something dumb or missing something simple. Any hints or pointers appreciated.
Not sure on the pinsel settings as its been a while since I've used lpc2000's (mostly xilinx , avr and st32f lately)
Thank you
Alex
pinsel
/* PinSelect and Pinmode settings */ /* UART0 = COM1 DB9 P4 on mcb2300 */ /* UART1 = COM1 DB9 P3 on mcb2300 */ /* UART2 = COM 2 is on IDC (TXD2=P2.8 (93), RXD2=P2.9 (92), GND=GND (103) */ /* UART3 = COM3 is on IDC (TXD3 = P0.0 (66), RXD3 = P0.1 (67), GND=GND (42) */ PINSEL0 = 0x4000005A; /* binary: 01000000_00000000_00000000_01011010 */ PINMODE0 = 0x800000AA; /* binary: 10000000_00000000_00000000_10101010 */ // IO0DIR = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINSEL1 = 0x00000001; /* binary: 00000000_00000000_00000000_00000001 */ PINMODE1 = 0x0000000A; /* binary: 00000000_00000000_00000000_00001010 */ PINSEL2 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINMODE2 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ // IO1DIR = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINSEL3 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINMODE3 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINSEL4 = 0x000A0000; /* binary: 00000000_00001010_00000000_00000000 */ PINMODE4 = 0x000A0000; /* binary: 00000000_00001010_00000000_00000000 */ // PINSEL4 = 0x000A000A; // binary: 00000000_00001010_00000000_00001010 FIO2DIR = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINSEL6 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINMODE6 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ FIO3DIR = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINSEL7 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINMODE7 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINSEL8 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINMODE8 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ FIO4DIR = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINSEL9 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */ PINMODE9 = 0x00000000; /* binary: 00000000_00000000_00000000_00000000 */
not quite right in lpc2300.s values are PCLKSEL0_Val EQU 0x00000000 PCLKSEL1_Val EQU 0x00000000 PCONP_Val EQU 0x03000018
doh very dumb error forgot to check if the mcb2300 has rs232 levels on uart 2 and 3(idiot!) so need to add a max563 or st232 chip to convert to rs232 levels