Hello all, I am new to embedded world, I am completing the half done proting FreeRTOS on P4080 (half done by someother person), my task is to build the vPortEnableInterrupts, vPortDisableInterrupts & write UART driver for it. I am able to access the SPRs by defining them in cpuregister.h file like this -
#define CDCSR0 696
#define HID0 1008
#define hid0 1008
#define srr1 27 ... etc etc..
and the I could easily load these registers using instruction set nemonics like for example
mtspr r5, srr1
But now to write the UART driver, how do I define its registers ?
in the reference manual they have given the description like this
17.5.1 UART1 receiver buffer register (DUARTx_URBR)
These registers contain the data received from the transmitter on the UART buses. In
FIFO mode, when read, they return the first byte received. For FIFO status information,
refer to the UDSR[RXRDY] description.
Except for the case when there is an overrun, URBR returns the data in the order it was
received from the transmitter.
Addresses: DUART1_URBR1 is 11C000h base + 500h offset = 11C500h
DUART1_URBR2 is 11C000h base + 600h offset = 11C600h
and also where do I have define them?
Please provide me with P4080 UART driver with its supporting files. Or atleast an example script of how can I use these registers.
Since this is my 1st project on embedded systems. your help will greatly appreciated.
regards,
Sam
Solved! Go to Solution.
Hi Sam,
These DUART registers are memory mapped registers (i.e. are accessible via memory and are mapped through CCSRBAR base address). The default CCSRBAR address value at P4080 is 0xfe000000.
So, you can simply define these registers as:
#define DUARTA_BASE (0xfe11c500)
#define DUARTB_BASE (0xfe11c600)
More of this, you can find in CW for PA a full example for P4080DS Serial in next path: PA\PA_Support\Serial\P4080DS_eabi_serial
Regards,
Marius
Hi Sam,
These DUART registers are memory mapped registers (i.e. are accessible via memory and are mapped through CCSRBAR base address). The default CCSRBAR address value at P4080 is 0xfe000000.
So, you can simply define these registers as:
#define DUARTA_BASE (0xfe11c500)
#define DUARTB_BASE (0xfe11c600)
More of this, you can find in CW for PA a full example for P4080DS Serial in next path: PA\PA_Support\Serial\P4080DS_eabi_serial
Regards,
Marius
Thank you very much Marius.
is it some thing like this ?
volatile UINT32 * DUART_URBR1 = (volatile UINT32 *)(0x11C500);
volatile UINT32 * DUART_URBR2 = (volatile UINT32 *)(0x11C600);