How can I set up an PIC16F887 for serial communication in Mikropascal? I need it to read 4800 baud, 8 data bits, no parity, and 1 stop bit. There is no handshake.
Simplest way would be to use the Help example on UART library. Searching the forum should give you some more elaborate examples.
I need to read 2 devices, is there a way to set this PIC up for reading two, or do I need two Pic's, and have them to interact?
Better to use a processor with two hardware UARTs.
I have tried to set it up for Uart and Soft Uart, and I get it to read bytes, but what i read makes no sense. It sends out a string of max 80 characters which I need to break down and handle afterwards.
I don't think it would work unless one used interrupts for both hardware and software UART (and not with mE's UART libraries).
Another (probably little) tricky thing is how I can get an ASCII code into a string. The Chr command requires a char type, and I cant find a way to convert char type into a string type.
The chr function does nothing in mP (though I use it in code to have it formally correct
). One cannot convert a char to string, but one may assign a char to string thus forming one-char string, for example
var st: string;
Then one may add next char