-
1. Re: GPIO output timing
BoonT_56 May 17, 2016 12:02 AM (in response to JeCh_627636)Is the below thread helpful to you?
Looking for suggestion for 100hz Pulse generating to GPIO on BCM20732S?
-
2. Re: GPIO output timing
JeCh_627636 May 17, 2016 1:20 AM (in response to BoonT_56)Thanks, but that doesn't help. What I ask is to shorten but not increase the delay. In my case, the pulse rate is about 500K~1MHz.
-
3. Re: GPIO output timing
BoonT_56 May 17, 2016 10:51 PM (in response to JeCh_627636)1 of 1 people found this helpfulMay I know what is the external component that you are driving? And where did you get the above piece of code?
-
4. Re: GPIO output timing
JeCh_627636 May 18, 2016 2:20 AM (in response to BoonT_56)It's a kind of LED driver with serial data/clock inputs. The piece of code we use (with gpio_setPinOutput and bleapputils_delayUs) is pretty similar to the thread as you said. Its was working for the old model with slower driver, but not for this new one.
-
5. Re: GPIO output timing
JacobT_81 May 18, 2016 3:39 PM (in response to JeCh_627636)2 of 2 people found this helpfulThis code will bring out a 2MHz (T = .5us) clock line onto pin 32:
#include "aclk.h"
gpio_configurePin(32 /16, 32 % 16, GPIO_KS_OUTPUT_ENABLE, GPIO_PIN_OUTPUT_HIGH);
aclk_configure(2000000, ACLK0, ACLK_FREQ_24_MHZ);
You can toggle it on and off to try to control your peripheral.
Alternatively, you can route this same clock line through the PWM which is specifically meant for these types of applications. Please see the pwm_tones application in the SDK for example code on using the PWM.
Jacob
-
6. Re: GPIO output timing
JeCh_627636 May 18, 2016 7:29 PM (in response to JacobT_81)My case is to send out serial data bits one time only (during each change). It's not like PWM with continuous waveform generation. I still hope to know how CPU can handle GPIO control in a fast way.
-
7. Re: GPIO output timing
JacobT_81 May 18, 2016 8:02 PM (in response to JeCh_627636)2 of 2 people found this helpfulThere's no faster way to toggle a GPIO. No timer callback will give you anything near 500ns. A clock line is the only thing that can achieve down to the nanosecond level.
The SPI hardware will be able to clock out chunks of 8 bits, but not just 1 bit at a time.
Jacob
-
-
9. Re: GPIO output timing
JeCh_627636 Jun 7, 2016 1:15 AM (in response to BoonT_56)still an issue, but just take a walk around with different driver.