Has anyone tried using the new UartByte interface in the TinyOS 2.0 release? Sending and receiving serial data using UartStream works fine, but the blocking UartByte.send never unblocks:

(/tos/chips/atm128/Atm128UartP.nc)
async command error_t UartByte.send( uint8_t byte ){
  call HplUart.tx( byte );
  while ( !call HplUart.isTxEmpty() );
  return SUCCESS;
}

The isTxEmpty is just checking a bit value from a register on the ATmega128:

(/tos/chips/atm128/HplAtm128UartP.nc)
async command bool HplUart0.isTxEmpty(){
  return READ_BIT(UCSR0A, TXC);
}

With code that looks like:
UartByte.send('U');
UartByte.send('F');

It prints the 'U', then freezes. From what I can tell, the TXC bit (6th) in the UCSR0A is never being set to 1 after the transmission completes. Has anyone used this successfully? Does something special need to be initialized for this to work (I tried explicitly calling enableTxIntr, but that didn't help).

Kind regards,

Jeff
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to