Other Parts Discussed in Thread: CC2650
Tool/software: Code Composer Studio
I am having a strange problem with CC2650MODA GPIO. I am using "simple_np_cc2650bp_app" project as my base project and adding my application functionality. One of the requirement I have is to generate fast IO to emulate 1-Wire protocol over a GPIO. I tried multiple different ways to generate minimum GPIO time I need starting with timer, using TI PIN driver, using direct PINCC26XX drivers and also writing to HWREG directly. But for some reason I am not able to get time period to few microseconds. System clock frequency is 48MHz and system tick is at 10usec.
For example as shown in code snippet below I am toggling GPIO (where ONE_PIN is DIO14 on CC2650MODA) without any other code or task sleep. But as you can see in the logic analyzer snippet I am getting 0.125us for transition from 0 to 1 but for transition from 1 to 0 it takes 31.31us. This is something I am not able to understand and I need help with asap.
I have tried disabling system tick timer using "Clock_tickStop()" before this code block and starting system tick timer again with "Clock_tickStart()". But it didn't made any difference. Actually project has only one active task, so task switching should not be an issue. The fastest frequency I can toggle with (0.125us + 31.31us) is close to 32KHz frequency. Is this the clock rate for I/O Control module because of which I can not toggle any faster?
To comply with the protocol I need to have at least 15us time period reliably.
/* Code Snippet */
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 0;
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 1;
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 0;
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 1;
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 0;
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 1;
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 0;
HWREGB(GPIO_BASE+GPIO_O_DOUT3_0+ONE_PIN) = 1;