Hi. Thanks for responding.
My code is modularised, but I will attempt to communicate the sense of it. I was suspecting that the BBees might be slow in their communication compared with other parts of the system, but I was assuming that the relatively slow 9600 baud should do the trick.
This is in my UART library:
uint8_t string[17] = { 0X48 , 0X65, 0X6C , 0X6C , 0X6F , 0X20, 0X57 , 0X6F, 0X72 , 0X6C , 0X64 , 0X20 , 0X0D , 0X0A , 0X00
};
void configure_usart(void){
struct usart_config config_usart_1;
usart_get_config_defaults(&config_usart_1);
config_usart_1.generator_source = GCLK_GENERATOR_4;
config_usart_1.baudrate = 9600;
config_usart_1.mux_setting = USART_RX_1_TX_0_XCK_1;
config_usart_1.character_size = USART_CHARACTER_SIZE_8BIT;
config_usart_1.data_order = USART_DATAORDER_LSB;
config_usart_1.parity = USART_PARITY_ODD;
config_usart_1.stopbits = USART_STOPBITS_1;
config_usart_1.parity = USART_PARITY_EVEN;
config_usart_1.pinmux_pad0 = PINMUX_PA16C_SERCOM1_PAD0 ; //tx
config_usart_1.pinmux_pad1 = PINMUX_PA17C_SERCOM1_PAD1 ; //rx
config_usart_1.pinmux_pad2 = PINMUX_UNUSED;
config_usart_1.pinmux_pad3 = PINMUX_UNUSED;
stdio_serial_init(&usart_instance_1, SERCOM1, &config_usart_1);
while (usart_init(&usart_instance_1, SERCOM1, &config_usart_1) != STATUS_OK) {
}
usart_enable(&usart_instance_1);
}
void SendStringViaBBee(void){
usart_write_buffer_job(&usart_instance_1, string, sizeof(string));
}
This is in my Main function:
while (1){
SendStringViaBBee();
delay_ms(800);
}
I will perhaps try make the buffer small and a delay function between each character being sent.
Thanks for your help.
Mike