I made a very simple test jig , where the system clock is set to 48MHz, no dividers. I am simply toggling a pin.
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
/* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */
/* Place your application code here. */
but I am not seeing the pin toggle at nearly the rate I would expect given the system clock speed. Frequency of the output is 350kHz, so it is 48MHz/350kHz = 137 off from 48MHz. I have a hard time believing that there are so many cycles per instruction. Rather, I am thinking something is not configured quite right in my project. What could it be?
Also, why is there a question mark under Desired for Sysclk?
I cannot see the question mark 😉
Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file. Also, tell us what board you used, Cypress Kit? Which one?? Self-made???
Now I see what you mean! Toggling a pin to its maximum speed by using the CPU is of no use:
For having a pin to output a frequency always use a PWM or a timer, you may even output a clock directly. This will avoid all the problems from above.
That was just a test jig for evaluating speed of operation. I was trying to determine why my bit banged spi bus was running so slowly. It doesn't run continuously, only occasionally and I did not lay out the board to take advantage of the built in SPI driver. I will do that on my next board spin. Thanks