I'm trying to communicate serially between a TWR-S08PT60 kit, and the hyperterminal in my PC,
with the Processor Expert component "term", and the code generated by it.
I seem to be having two different problems, I don't know if they are related to each other...
First, the baudrate is off by roughly 10%
When I set it to 9600 baud, the length of one bit sent from the mcu is 115us instead of 104us
Here are a couple of screenshots on how I've set the timing:
(I changed the internal oscillator to 36kHz to allow for a wide variety of baud rates)
I can trick it into communicating in the correct baud rate if I set the baud rate to 10500 though...
The second problem is more critical.
When the mcu is reading a character from the PC, it's reading two characters even if there are only one sent.
The following code should echo the received character back to the PC:
unsigned char ch;
But in my case it echoes back two characters for every character it receives.
The first character sent is the same as it receives (as long as I have set the baudrate to 10500),
the second one is the same as the first BUT shifted one bit.
ie. if i send an ascii '4' (0x34)=(00110100) from the PC
I will receive '4Ü' from the mcu.
I've tried this with both CW 10.5 and CW 10.6, but with the same result.
I've earlier done exactly the same thing with CW 10.2 and a MC9S08AW60 mcu, and it has worked well.
I've double checked the baud rate/parity/stop bit settings in hyperterminal.
Have I forgotten some settings, or is this a bug?
I'm very grateful for any input!