AtomSoft
Well-Known Member
Im trying to write a ROM string out to UART at high speed (even at low speed same results)
My Speed is 115.2kbps (using a 14.7456MHz Crystal)
NO PLL ...
The code works as i get the message on my terminal but it does not create a Line Feed...
I tried:
\n\r --------and-------\r\n
\xA\xD --------and-------\xD\xA
ALSO TRIED:
welcome[]....
NO LUCK! You think its my terminal ? Im using Putty (0.62) (windows 7)
Thanks in advance guys (and some gals)
My Speed is 115.2kbps (using a 14.7456MHz Crystal)
NO PLL ...
Code:
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
}
}
The code works as i get the message on my terminal but it does not create a Line Feed...
I tried:
\n\r --------and-------\r\n
\xA\xD --------and-------\xD\xA
ALSO TRIED:
welcome[]....
NO LUCK! You think its my terminal ? Im using Putty (0.62) (windows 7)
Thanks in advance guys (and some gals)
Last edited: