XMega Timer and Microseconds
问题 I'm trying to bit bang out some data out of an atxmega128a3u and need to toggle a pin as fast as 4us but so far I'm not getting anywhere close to that... Here I'm setting my timer for 88us but am getting around 146us. int main(void) { //CRYSTAL SETUP OSC_XOSCCTRL = OSC_FRQRANGE_12TO16_gc | OSC_XOSCSEL_XTAL_16KCLK_gc; // 16Mhz Crystal OSC_CTRL |= OSC_XOSCEN_bm; while(!(OSC_STATUS & OSC_XOSCRDY_bm)); //Wait for crystal to stabilize. CCP = CCP_IOREG_gc; CLK_CTRL = CLK_SCLKSEL_XOSC_gc; //END