Hi Guys,
I've updated the program, and used the latest winavr distro, and its still see
nothing in hyperterminal. Just to give more background, I have receiving
working fine. Also the origional code seems to transmit ok, so I gradually
removed parts of the code & re-tested, gradually it got more unreliable (only
sending a message every 3 times it was turned on), then just sent one space
instead of the message, until it did nothing, and this was just by removing
code not relevant to transmitting! In one case removing an unsued global int
stopped it working! What could cause something like this?
Thanks for all the help,
Laurence
#include <avr/io.h>
char *message = "Testing, testing, 1-2-3";
int main()
{
char c, *buf = message;
// Enable transmitting, 9600bps (clock is 4Mhz)
UCR = _BV(TXEN);
UBRR = 25;
while ( ( c = *buf++ ) != '\0' ) {
UDR = c;
loop_until_bit_is_set( USR, UDRE );
}
return 0;
}