Tool/software:
Hi all TI experts:
I am using the AM2431 with FreeRTOS as the system. In one of the threads, I need to control multiple GPIO high/low signals as control signals to manage a peripheral. I am using a for loop to output continuous signals, but I have noticed a longer delay when setting the signal low.
void my_delay(uint32_t ticks) { volatile uint32_t delay; hGpio1->BANK_REGISTERS[0].SET_DATA = 0x00000400; for (delay = 0; delay < ticks; delay++) { NOP_DELAY; } hGpio1->BANK_REGISTERS[0].CLR_DATA = 0x00000400 } for (scanline = 18; scanline > 0; scanline--) { / for (channel = 16; channel > 0; channel--) { for (driver = 20; driver > 0; driver--) { value = hGpio1->BANK_REGISTERS[0].OUT_DATA; value |= (((Value1 << 1); value |= (((Value2 << 10); value |= (((Value3 << 13); value |= (((Value4 << 21); value |= (((Value5 << 22); value |= (((Value6 << 30); hGpio1->BANK_REGISTERS[0].OUT_DATA = value; my_delay(delayTime); } } }
In order to make my GPIO control as stable as possible, I didn’t use vTaskDelay
. Instead, I used a for
loop with NOP_DELAY
inside to prevent the process from switching to other threads. However, I noticed something unusual with the output waveform. I added a GPIO toggle before and after the delay, and by observing this GPIO with a logic analyzer, I found that the low time is almost twice as long as the high time. I didn’t find an option to set the GPIO speed in syscfg
, but a simple for
loop shouldn’t have this effect. I also tried removing the value operation, but the low time still didn’t decrease. Is there any way to improve this?
best regards,
Larry