Hi Guys,
I'm coming from V2 Coldfire land where (to me anyway!) setting the CPU frequency was simple.
I'm prototyping with a QG8 and I'm not sure how to set the clockrate properly. Processor expert is equally as confusing about what fields mean what.
The biggest issue I'm seeing is that at 3.3V with nothing else hooked up to the part (BDM removed) and it executing code the chip is drawing a little over 2mA, which seems really high. I'm using the internal clock source.
The datasheet says that at ~1MHz it should be using somewhere around 0.5mA, but I'm not sure that is possible without using an external clock or crystal.
Any tips are much appreciated!
Thank You,
Spencer
Hi Spencer,
this additional current points me allways to unused pins state, avoid floating state of inputs there.
Configure all of them as outputs or enable pull ups where applicable.
Pavel
Hello Spencer, and welcome to the forum.
Since the current draw of about 2 mA is reasonable for higher bus frequencies, maybe you do not have a 1 MHz bus frequency.
For FEI mode, with 1 MHz bus frequency, I would expect the ICS register settings to be -
ICSC1 = 0x04;
ICSC2 = 0xC0;
Here, the ICSC2_BDIV bits are set to divide the DCO output frequency by 8. A further division by 2 provides the bus frequency.
To achieve a bus frequency of exactly 1 MHz, you will need to calibrate the NV trim setting (during the programming process) to give a reference frequency of 31.25kHz, and this setting will need to be loaded to the trim register of the ICS module during the initialisation process.
It is also possible for the current draw to increase if unused GPIO inputs, including any non-pinned GPIO, remain in a floating state. Your choice is either to enable internal pullups, or to set the GPIO as outputs.
Regards,
Mac
Hello Bigmac,
I´m working with the QB8 right now and I have a question about the resulting 1 MHz bus frequency, because I also want to achieve that.
If I use the internal reference clock, which is 20 MHz, and set the ICSC2_BDIV to 0x11 = 8, then the ICSOUT signal has a frequency of 20/8 = 2.5 MHz right? The devision by 2 results in a bus frequency of 1.25 MHz or am I missing something here?
Regards,
Ben
Okay - I found my mistake.
The frequency is provided by the DCO with ~31.25kHz and FLL factor (if ICSSC = 0x00) of 512, thus the DCO output frequency is 16 MHz. Divided by 8 and by 2 it results in a 1 MHz bus frequency.