Theremingenieur
Senior Member+
General technical question out of the context, not directly MK66/64 related: can the bus clock divider be modified after booting, for example in the setup() part of a sketch?
Would you suggest working off of Beta2 or off of clone of cores?
Should we coordinate library testing / porting with a list in this thread or via github-issues?
180MHz: Maybe there is a trick and the IRC48 clock canbe used somehow.
just for fun, i tried 240 MHz... works.. (but not with SIM_CLKDIV1_OUTDIV4(8); instead value 7 works (?))
Edit:
...but F_BUS with 240MHz does not workOh, there is indeed a limit..
![]()
Yes, 16MHz. And there is no divisor.
But the K66 has an own 48MHz clock for USB - At the moment, i don't know if both can be used simultanously.
If not, there is a way NOT to use the crystal @ 180 MHZ, and instad the 48MHz clock only.
Had this seen on a forum (Freescale?), but I lost the bookmark..
Ok, that make sense, something related divisor maybe?, btw I already feel there's a demon fast beast inside!@sumotoy: For 180MHz, USB is not supported at the moment.
Yes, all libs need a change if modifing F_BUS... will take some weeks
#ifdef F_BUS
#undefine F_BUS
#define F_BUS 96000000
#endif
void ax12Init(long baud, Stream* pstream, int direction_pin ){
// Need to enable the PU resistor on the TX pin
s_paxStream = pstream;
s_direction_pin = direction_pin; // save away.
// Lets do some init here
if (s_paxStream == &Serial) {
Serial.begin(baud);
}
if (s_paxStream == (Stream*)&Serial1) {
Serial1.begin(baud);
#if defined(__MK20DX256__) || defined(__MKL26Z64__)
if (s_direction_pin == -1) {
UART0_C1 |= UART_C1_LOOPS | UART_C1_RSRC;
CORE_PIN1_CONFIG = PORT_PCR_DSE | PORT_PCR_SRE | PORT_PCR_MUX(3) | PORT_PCR_PE | PORT_PCR_PS; // pullup on output pin;
} else {
Serial1.transmitterEnable(s_direction_pin);
}
#elif defined(TEENSYDUINO)
// Handle on Teensy2...
if (s_direction_pin != -1) {
Serial1.transmitterEnable(s_direction_pin);
}
#endif
}
...
You could use #if defined(KINETISK) and get all 4 teensy3*My first pass will be to probably add some more to the first #if
I don't think so. the F_BUS symbols are used at compile time. setup() is runtimePerhaps a simple
After modifying the divider in setup() as in the example above would do the job?Code:#ifdef F_BUS #undefine F_BUS #define F_BUS 96000000 #endif
Perhaps a simple
After modifying the divider in setup() as in the example above would do the job?Code:#ifdef F_BUS #undefine F_BUS #define F_BUS 96000000 #endif
Mine arrived today (gorgeus!) and just tested with TFT_ILI9163C library (modified).
UPDATE:
Looks like it doesn't like Serial at 180Mhz.
Sounds good, tried in my own library and fixed it.You could use #if defined(KINETISK) and get all 4 teensy3*
Sure, here's only parts to be replacedsumotoy can you drop a zip of your TFT_ILI9163C mods? I just soldered a display board and starting with the ILI9341.
Sure, here's only parts to be replaced