Uart IBRD/FBRD's offset - Raspberry Pi Forums


hi! i'm having problems initialize pl011. datasheet's instructions not work @ all. base adress wrong, knows. i'm working in physical adress 0x20201000.
communication works @ bit rate of 115200 only, configuring ibrd , fbrd registers following datasheet instructions not have effect. values have put in registers work @ 19200 baud? board's model rpi b+ rev. 1.2
i'm not sure register's offsets informed datasheet or uart clock of board calculate integer , fractional part of baud rate generator. i'm trying 19.2mhz ibrd = 19200000/(16*19200) = 62 , fbrd = 0.5*64 = 32. none values enter doing effect. sorry boring text :oops:
i'm not using linux, o.s custom.
code:
static volatile uint *uart_base;
#define uart0 0x20201000// base addres uart0
#define uart_dr 0x0 // data register ok
#define uart_rsr 0x4 // receive status register/error clear register
#define uart_fr 0x6 // flag register
#define uart_ibrd 0x24 // integer baud rate register
#define uart_fbrd 0x28 // fractional baud rate register
#define uart_lcrh 0x2c // line control register
#define uart_cr 0x30 // control register
#define uart_ifls 0x34 // fifo control register
#define uart_imsc 0x38 // interrupt mask set/clear register
#define uart_mis 0x10 // status masked interrupt register
#define uart_icr 0x44 // interrupts flags
// bits in registers
#define uart_rxi (1 << 4) // receive interrupt

void u0init(void)
{
uart_base = (void*)uart0;// (void*) prevent compilator's boring warning
uart_base[uart_cr] = 0x00; // disable uart
uart_base[uart_icr] = 0x7ff; /* clear interrupt status */
uart_base[uart_ibrd] = 62;// 19200000 / (16x19200)
uart_base[uart_fbrd] = 32;// (19200000 % (16x19200) )*64
uart_base[uart_imsc] = uart_rxi;
uart_base[uart_ifls] = 0x24; // transit/receive fifos
uart_base[uart_lcrh] = 0x70; // 8, n, 1 - fifo enabled
uart_base[uart_cr] = 0x301; // enable uart
}
exemple, fr register's offset in datasheet 0x18 not work me, 0x6 worked! because i'm thinking there more wrong information... can me? forgot something? doing wrong? :?:
thanks!



raspberrypi



Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support