Go Down

Topic: Clock for the FPGA (Read 225 times) previous topic - next topic

Tempest15

The guys from Arduino said the samd21 chip has its own oscillator to generate a 48MHz clock that is fed into the FPGA.

When i looked into the schematic of the vidor, i found that pin PA27 is connected to the FPGA pin E2 and it is labled SAM_PORTS.GCLK.

Is there a way to enable the clock on this pin in the samd21?
When i tried to use it for a clock divider that i programmed inside the FPGA, nothing happened.

tksm372

I think an easy way is to use the enableFpgaClock() in a sketch.

Code: [Select]
extern void enableFpgaClock();

void setup() {
  enableFpgaClock();
  ...
}


The enableFpgaClock() is defined in
C:\Users\(your id)\AppData\Local\Arduino15\packages\arduino\hardware\samd_beta\1.6.25\variants\mkrvidor4000\variant.cpp.
Code: [Select]
void enableFpgaClock() {
  // Will be called by the Vidor library begin()
  pinPeripheral(30, PIO_AC_CLK);
  clockout(0, 1);
  delay(1000);
}
Minatsu Tukisima

Go Up