What is the GPIO port speed in respect to the core clock frequency? In other words can I toggle any or a set of I/O pins with the core clock frequency of 60 MHz?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
What is the GPIO port speed in respect to the core clock frequency? In other words can I toggle any or a set of I/O pins with the core clock frequency of 60 MHz?
Piccolo datasheets section 6.10.1
15 MHz
Other useful GPIO information in the datasheet you may not have seen
The user can select the type of input qualification for each GPIO pin via the GPxQSEL1/2 registers from
four choices:
• Synchronization To SYSCLKOUT Only (GPxQSEL1/2 = 0, 0): This is the default mode of all GPIO pins
at reset and it simply synchronizes the input signal to the system clock (SYSCLKOUT).
• Qualification Using Sampling Window (GPxQSEL1/2 = 0, 1 and 1, 0): In this mode the input signal,
after synchronization to the system clock (SYSCLKOUT), is qualified by a specified number of cycles
before the input is allowed to change.
• The sampling period is specified by the QUALPRD bits in the GPxCTRL register and is configurable in
groups of 8 signals. It specifies a multiple of SYSCLKOUT cycles for sampling the input signal. The
sampling window is either 3-samples or 6-samples wide and the output is only changed when ALL
samples are the same (all 0s or all 1s) as shown in Figure 4-18 (for 6 sample mode).
• No Synchronization (GPxQSEL1/2 = 1,1): This mode is used for peripherals where synchronization is
not required (synchronization is performed within the peripheral).
Other helpful GPIO frequently asked questions: http://processors.wiki.ti.com/index.php/General_Purpose_IO_%28GPIO%29_FAQ_for_C2000
Hello,
Thank you for the answer. I have a few other questions.
1. How many system clock cycles does it take to toggle a GPIO pin from low to high and back?
2. Is there a table that shows the number of clocks per instruction?
3. Is there an assembly language programming help/tutorial or example to follow for F28027 MCU?
The bulk of my code will be in C, but a very short subroutine has to be in assembly to maximally utilize the microcontroller. I need to get switching frequency on 18 outputs from 8 to 12 MHz. My previous similar design was done on SiLabs MCU.
1. you can write to the GPIO register and use the toggle bit in 1 cycle
2. it's all single cycle instruction (for each assembly instruction), but C functions take different amounts of time, you have to use the CCS tools to see exactly, can depand on many factors
3. you don't really need to use assembly, especially for the toggling. please read this wiki and the appnote
Hello Chris,
I'm running the clock at 60 MHz and I can see and verify it on GPIO-18, XCLKOUT. Then I have the following simple pin toggle code,
for(;;) {
GpioDataRegs.GPBDAT.bit.GPIO33 = 1;
GpioDataRegs.GPBDAT.bit.GPIO33 = 0;
}
I see only 2.5 MHz square wave on the pin GPIO-33, that I configured as an output.
here is a disassembly for the short loop
0x3F6188: 761F01BF MOVW DP,#0x01BF
0x3F618A: 1A080002 OR @8,#0x0002
0x3F618C: 1808FFFD AND @8,#0xFFFD
0x3F618E: 6FFA SB C$L1,UNC
Is there anything else to configure to get the pin to toggle faster? Does GPIO data exchange run at the main clock frequency? I looked the reference guide and the datasheet all over, but could not find any info on that.
I've added more info to the wiki article to clarify
http://processors.wiki.ti.com/index.php/General_Purpose_IO_(GPIO)_FAQ_for_C2000
Cheers
Lori
Does " Back-to-back DAT register writes do not work as expected " answer also apply to Delfino series DSPs?
Arsen N. said:Does " Back-to-back DAT register writes do not work as expected " answer also apply to Delfino series DSPs?
Yes.
-Lori
Hi Lori,
Here is a tricky question, does " Back-to-back DAT register writes do not work as expected " answer apply to the code that runs from RAM or from FLASH only? My code is working surprisingly fast while running from RAM. Is there a chance that " Back-to-back" issue does not apply to RAM? Below is my code. Somewhere before the main loop I call MemCopy(bla-bla-bla) subroutine copied from one of the examples, along with FlashInit().
void PatternLoad(Uint16 *intPtrnPtr) {
Uint16 Frame, Ptrn;
for(Frame = 0; Frame <0x01E0; Frame++) { // 01E0 Scanning 480 points in space
for (Ptrn = 0; Ptrn < 0x0190; Ptrn++) { // Loading 400 bit pattern
GpioDataRegs.GPADAT.all = *intPtrnPtr; // Setting data from EEPROM on GPIO 0-31
GpioDataRegs.GPBDAT.bit.GPIO33 = 1; // Clocking data out GPIO33
GpioDataRegs.GPBDAT.bit.GPIO33 = 0; // Clear clock
*intPtrnPtr++; // Next pattern
}
GpioDataRegs.GPBDAT.bit.GPIO32 = 1; // Setting latch GPIO32
GpioDataRegs.GPBDAT.bit.GPIO32 = 0; // Clear latch
}
}