|
FT800Q
Jul 24, 2014 17:40:56 GMT -8
Post by isyre on Jul 24, 2014 17:40:56 GMT -8
from the gd2.brd i can not find the PIN13 PIN14 of FT800Q connect to crystal? why?
|
|
|
FT800Q
Jul 25, 2014 7:46:44 GMT -8
Post by jamesbowman on Jul 25, 2014 7:46:44 GMT -8
Good question!
The GD2 design runs the FT800Q without a crystal, which is a design option for the FT800Q. This saved a little on the BOM for the board, and makes layout easier with a 2-layer PCB.
The FT800Q can run from an internal oscillator, there is an application note from FTDI on how to do this. The trick is to boot into internal oscillator mode, which runs at 20-30 MHz. Then have the MCU (Arduino, etc) measure the FT800Q's frequency and increase the FT800Q register REG_TRIM until the frequency is close to the desired 48 MHz. Then to get the fine-tuning right, set REG_FREQUENCY to the actual frequency achieved; this gets the FT800Q's audio in tune.
Here is the implementation from GD2.cpp:
uint32_t GDClass::measure_freq(void) { unsigned long t0 = GDTR.rd32(REG_CLOCK); delayMicroseconds(15625); unsigned long t1 = GDTR.rd32(REG_CLOCK); return (t1 - t0) << 6; }
#define REG_TRIM 0x10256C #define LOW_FREQ_BOUND 47040000UL
void GDClass::tune(void) { uint32_t f; for (byte i = 0; (i < 31) && ((f = measure_freq()) < LOW_FREQ_BOUND); i++) GDTR.wr(REG_TRIM, i); GDTR.wr32(REG_FREQUENCY, f); }
|
|