Hi, I wish to drive WS2812 LEDs with the XMEGA USART peripheral and I have a problem when setting up baudrates over 2MHz.
Up to 2MHz everything is fine, the clock is rock solid 0.5us period, but when I try to set the baudrate to anything over 4MHz I see an odd 0.33us period... (testing the port speed with the classic putchar(0x55) square wave trick )
The processor is running off of an external 16MHz crystal, I'll post the conf_clock.h below.
#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL #define CONFIG_SYSCLK_PSADIV SYSCLK_PSADIV_1 #define CONFIG_SYSCLK_PSBCDIV SYSCLK_PSBCDIV_1_1 #define CONFIG_PLL0_DIV 1 #define CONFIG_PLL0_MUL 3 #define BOARD_XOSC_HZ 16000000UL #define BOARD_XOSC_STARTUP_US 1000 #define BOARD_XOSC_TYPE XOSC_TYPE_XTAL #define CONFIG_XOSC_RANGE XOSC_RANGE_12TO16 #define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL
Does anyone know what could be wrong?