When I try to write to one of the UARTs on this Zilog Z8 chip the data arrives all mangled up. I've triple-checked the baud/parity/data/stop bits and they all match, still my data arrives all garbled (but exactly the right number of characters.)
Can anyone recommend where to look for problems? Here is my code;
===========================================
#include <eZ8.h>
void main(void) {
int n,msglen, m,z;
char Status;
char Msg[28]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
PAADDR = 0x02; //point PAADDR at the alternate function register
PACTL = 0x30; // set uart0 Rx & Tx pins to alternate function
PAADDR = 0;
U0BRH = 0x01; //2400 (480) hi-byte
U0BRL = 0xe0; //2400 (480) lo byte
U0CTL0 = 0xC0; // Transmit enable, Receive Enable, No Parity, 1 Stop
msglen = sizeof(Msg);
for(n=0;n<msglen;n++) {
for(m=0;m<0xff;m++)
for(z=0;z<0xff;z++)
;
U0TXD = Msg[n]; // send char
}
}
Can anyone recommend where to look for problems? Here is my code;
===========================================
#include <eZ8.h>
void main(void) {
int n,msglen, m,z;
char Status;
char Msg[28]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
PAADDR = 0x02; //point PAADDR at the alternate function register
PACTL = 0x30; // set uart0 Rx & Tx pins to alternate function
PAADDR = 0;
U0BRH = 0x01; //2400 (480) hi-byte
U0BRL = 0xe0; //2400 (480) lo byte
U0CTL0 = 0xC0; // Transmit enable, Receive Enable, No Parity, 1 Stop
msglen = sizeof(Msg);
for(n=0;n<msglen;n++) {
for(m=0;m<0xff;m++)
for(z=0;z<0xff;z++)
;
U0TXD = Msg[n]; // send char
}
}