rom char welcome[23] = "AtomSoftTech Hey\xD\xA";
//... Init UART
init_uart();
//...SEND ROM STRING
UartRomStr(welcome);
//... Functions
void init_uart(void){
TRISC = 0b10000000;
TXSTAbits.SYNC = 0;
BAUDCTLbits.BRG16 = 0;
TXSTAbits.BRGH = 1;
SPBRG = 7; //115,200bps (115.2Kbps) for 14.7456 MHz
RCONbits.IPEN = 1;
IPR1bits.RCIP = 1; //PRIORITY
TXSTAbits.TXEN = 1; //ENABLE TX
RCSTAbits.CREN = 1; //ENABLE RX
RCSTAbits.SPEN = 1; //ENABLE SERIAL PORT and PIN Config
//Disable All Interrupts
PIE1 = 0;
PIR1 = 0;
INTCON = 0;
Delay10TCYx(100);
}
void UartRomStr(rom char *string){
char temp = 0;
while(*string)
{
temp = *string++;
while(!PIR1bits.TXIF); //wait until TXIF is high
TXREG = temp; //put byte into Transmit Register
}
}