This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

button exmaple is not working in SDK version 9.0.0

Hello evryone,

i cloned button example form github to sdk version 9.0.0 and i modified the neccesary changes between app.gpiote.c//nrf_drv_gpiote.c files and set the GPIOTE ENABLED to 0 after that it is getting compiled with no errors but the baord shows nothing if the press any of the button can anyone suggest me what modifications has to be done or any changes?

ble_app_template.zip

Thank you

prabhu

Parents
  • Hi prabhudurai,

    still havent gone through your code, but had a quick look. I saw this below code in your init_gpio() function

    NRF_GPIO->PIN_CNF[6] = (GPIO_PIN_CNF_DRIVE_H0D1 << GPIO_PIN_CNF_DRIVE_Pos);

    This is wrong as you are setting every other bits to '0' and only setting the drive strength. With this the pin will be configured as input. To do this correctly, you need to do this below

    NRF_GPIO->PIN_CNF[6] &= ~(GPIO_PIN_CNF_DRIVE_Msk); // reset drive setting
    NRF_GPIO->PIN_CNF[6] |= (GPIO_PIN_CNF_DRIVE_H0D1 << GPIO_PIN_CNF_DRIVE_Pos); // set to high drive
    

    you need to do this for pin settings 7 also.

  • Thank you so much for your kind reply now i can able to make the buzzer work in SDK 9 itself but i am using this function

    app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(160UL,6,7);//6.3KHz

    pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;

    i connected two buzzers inorder to test both the pin are providing current but only the 6 pin of the buzzer is making beep sound if i set the acitive polarity to LOW and for the pin 7 it does not making any sound and it is not working i dont know there is some issue in my gpio configuration ? and also i checked the voltage on both pins by keeping this configuration

    NRF_GPIO->PIN_CNF[6] = (GPIO_PIN_CNF_DRIVE_H0H1 << GPIO_PIN_CNF_DRIVE_Pos)

    bot the pins are showing voltage 2.9 but after the buzzer making sound the voltage on the pin 6 drops to 1.44v and the voltage on the pin 7 remains 2.9but it is not producing any sound i dont understand why this happening and how to produce beep sound on both pins 6 and 7 can you please suggest me some ideas

Reply
  • Thank you so much for your kind reply now i can able to make the buzzer work in SDK 9 itself but i am using this function

    app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(160UL,6,7);//6.3KHz

    pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;

    i connected two buzzers inorder to test both the pin are providing current but only the 6 pin of the buzzer is making beep sound if i set the acitive polarity to LOW and for the pin 7 it does not making any sound and it is not working i dont know there is some issue in my gpio configuration ? and also i checked the voltage on both pins by keeping this configuration

    NRF_GPIO->PIN_CNF[6] = (GPIO_PIN_CNF_DRIVE_H0H1 << GPIO_PIN_CNF_DRIVE_Pos)

    bot the pins are showing voltage 2.9 but after the buzzer making sound the voltage on the pin 6 drops to 1.44v and the voltage on the pin 7 remains 2.9but it is not producing any sound i dont understand why this happening and how to produce beep sound on both pins 6 and 7 can you please suggest me some ideas

Children
No Data
Related