Hi everyone. I have connected an ESP8266 to my ATTiny2313 via UART. It works great. However if my ESP8266 gets rebooted it ends up shooting out a bunch of garbage before loading Init.lua and correcting it baud rate with the following result.
> c_ÇRSöfJSúfJÃjêM†ÿËãÛÊÏoËSÆËÏInit Loading
listening, free: 18360
Setting up webserver
> !ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
The incomming data is at buad 115200. When the very first line is sent to the ATtiny2313 it appears to lock up the controller from continuing through its main loop. Is there any way to stop that UART from being rendered at all or do I need a watch dog to prevent my controller from being locked in the ISR? The next option I have unforunitly would be to recompile the ESP nodeemu binary to stay in that baud but that would take a chunk of work. I've tryed also asking the Attiny2313 to use ODD Parity and two stop bits but that 115200 is still trying the ISR for some reason?
Thanks everyone for the help!
void InitUART (unsigned char baudrate)
{
UBRRH = (uint8_t)(MYUBBR >> 8); //Set baud rate
UBRRL = (uint8_t)(MYUBBR); //Set baud rate
// Set
UCSRB = _BV(TXEN) | _BV(RXEN) | _BV(RXCIE);
UCSRC = (1<<USBS)|(3<<UCSZ0);//Set frame format
}
ISR(USART_RX_vect){
buffer[rx_read_pos]=UDR;
if (buffer[0] != '!')
{
return; //Start Char
}
}
> c_ÇRSöfJSúfJÃjêM†ÿËãÛÊÏoËSÆËÏInit Loading
listening, free: 18360
Setting up webserver
> !ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
!ESP8266_0a802d|PW: 12345678
The incomming data is at buad 115200. When the very first line is sent to the ATtiny2313 it appears to lock up the controller from continuing through its main loop. Is there any way to stop that UART from being rendered at all or do I need a watch dog to prevent my controller from being locked in the ISR? The next option I have unforunitly would be to recompile the ESP nodeemu binary to stay in that baud but that would take a chunk of work. I've tryed also asking the Attiny2313 to use ODD Parity and two stop bits but that 115200 is still trying the ISR for some reason?
Thanks everyone for the help!
void InitUART (unsigned char baudrate)
{
UBRRH = (uint8_t)(MYUBBR >> 8); //Set baud rate
UBRRL = (uint8_t)(MYUBBR); //Set baud rate
// Set
UCSRB = _BV(TXEN) | _BV(RXEN) | _BV(RXCIE);
UCSRC = (1<<USBS)|(3<<UCSZ0);//Set frame format
}
ISR(USART_RX_vect){
buffer[rx_read_pos]=UDR;
if (buffer[0] != '!')
{
return; //Start Char
}
}