I am using soft_uart as a debug output on some projects, but with the new
PRO version i got suspicious chars.
I have tested a code sequence here to show you.
It works simple by sending out 2 chars on each comport, the 1st is Soft_Uart and the 2nd is UART1, both on 9600 baud
On the Soft_Uart i got F9 A0 FF (3 bytes) and on UART1 i got FD 50 (2 bytes) witch is right 50 is ascii P
It might be that soft_uart use fault delay time regarding oscillator fq in compiler code ?
Here is the testcode
Code: Select all
/*
Prog Demo testing soft comms vs Uart comms
uProc dSPIC 30F3013
FQ Xtal 12.0000 MHz
Osc HS No PLL
*/
char ch = 0XFD; // Test HEX data char
char ASCIIP = 'P'; // Test Ascii letter P
void main() {
UART1_Init(9600); //Setup UART1 9600 8 N 1
U1MODEbits.ALTIO = 1; // Use alternative pins
Soft_UART_Init(&PORTB, 0, 1, 9600, 0); //Setup Soft Comms on PortB0 / B1
do {
soft_uart_write(ch); // Print out HEX value on soft comm
soft_uart_write(ASCIIP); // Print out Ascii P on soft comm
UART1_Write(ch); // Do the same print on UART1 comms
UART1_Write(ASCIIP);
delay_ms(1000); //Repeat every sec
}
while(1);