Regarding Delay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-16 5:01 AM
Hi..... i am a masters student from india. I have developed a code for RGBW now i want to include strobe effect for that i have give a hal_delay it is working fine now i want to change the PWM of RGBW when it is in strobe effect both has to work simultaneously but it is getting hanged i think this is due to Hal_delay i think this problem will be reduced if i give timer delay or i want to do something if it will solved with timer how to give timer delay in STM Controller.. I am using STM32F407VG controller.. Can someone help me out in this....... Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-27 2:12 AM
that's for my OS,
I check if DMAs are done, reissue commands in there...
you don't need it when you use blocking code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-27 2:33 AM
Ok..... Thank You...... I'll check
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-11-14 9:04 PM
- void wait_us(int uS) {
- resetTimChanneluSCounter(&htim5, 1, uS);
- waitTimChannelComplete(&htim5, 1);
- }
- void resetTimChanneluSCounter(TIM_HandleTypeDef *htim, uint32_t channel, int16_t uS) { // tuned to F767
- htim->Instance->CCR1 = htim->Instance->CNT
- htim->Instance->SR = !TIM_SR_CC1IF; // clear the flag
- }
- void waitTimChannelComplete(TIM_HandleTypeDef *htim, uint32_t channel) {
- uint32_t tmp;
- tmp = 0;
- while( ! tmp ){
- tmp = htim->Instance->SR & TIM_SR_CC1IF;
- }
- // used to have &=
- htim->Instance->SR = ! TIM_SR_CC1IF; // clear the flag
- break;
- }
- //******************
- start_Timer5();
- while(1){ ....... }
- in your code:
- SetPWM(x,dutycycle);
- SetPWM(y,dutycycle);
- SetPWM(z,dutycycle);
- wait_us(1000); // blocking code
- SetPWM(x,0);
- SetPWM(y,0);
- SetPWM(z,0);
wait_us(1000);
I have written the code like this blinking also not taken place. What is the mistake
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-11-15 10:41 PM
- void wait_us(int uS) {
- resetTimChanneluSCounter(&htim5, 1, uS);
- waitTimChannelComplete(&htim5, 1);
- }
- void resetTimChanneluSCounter(TIM_HandleTypeDef *htim, uint32_t channel, int16_t uS)
- {
- htim->Instance->CCR1 = htim->Instance->CNT + uS_Counts;
- htim->Instance->SR = !TIM_SR_CC1IF; // clear the flag
- }
- void waitTimChannelComplete(TIM_HandleTypeDef *htim, uint32_t channel) {
- uint32_t tmp;
- tmp = 0;
- while( ! tmp ){
- tmp = htim->Instance->SR & TIM_SR_CC1IF;
- }
- htim->Instance->SR = ! TIM_SR_CC1IF; // clear the flag
- }
- //******************
- start_Timer5();
- int main()
- {
- while(1){ SetPWM(x,dutycycle);
- SetPWM(y,dutycycle);
- SetPWM(z,dutycycle);
- wait_us(10); // blocking code
- SetPWM(x,dutycycle);
- SetPWM(y,dutycycle);
- SetPWM(z,dutycycle);
- }
- }
I have written the code like this but it is not working blinking also not happening any mistake

- « Previous
-
- 1
- 2
- Next »