2 * fwbc.c - broadcast the betty tv original firmware via uart0
3 * use fwdump to write it onto your computers harddisk
5 * author: hackbard@hackdaworld.org
11 #define OSC_CLOCK 10000000
14 #define P_CLOCK (OSC_CLOCK/P_DIV)
16 typedef unsigned char u8;
17 typedef unsigned int u32;
19 void uart0_init(u32 br) {
21 /* pin select -> tx rx */
22 PINSEL0&=~((1<<0)|(1<<1)|(1<<2)|(1<<3));
23 PINSEL0|=((1<<0)|(1<<2));
27 //UART0_DLL=((OSC_CLOCK/(16*br)))&0xff;
28 //UART0_DLM=(((OSC_CLOCK/(16*br)))&0xff00)>>8;
33 UART0_LCR=((1<<0)|(1<<1));
35 /* activate rx tx fifo */
36 UART0_FCR|=((1<<0)|(1<<1)|(1<<2));
39 void uart_send(u8 byte) {
41 /* wait for empty transmit buffer */
42 while(!(UART0_LSR&(1<<5)))