PWM Timer on the Wireless UART example not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PWM Timer on the Wireless UART example not working

2,353 Views
urban_sharon
Contributor III

Hi,

I am usgin the QN9090DK.

I have followed the code in the pwn_output sample project to define my own PWM timer in the wireless_uart sample project. While the timer is operational in the pwn_output project, it does not work in the project based on the wireless_uart project.

I have tried the above on both the BM and FreeRTOS versions with following results:

- In the BM project, the IRQHandler is not run/hit at all.

- In the FreeRTOS project, the IRQHandler is run/hit once, with a strange behaviour: the handler function tries to print "test", and on the terminal I get "t" printed, and only once, whist the timer is set to run forever.

I can't understand what is going wrong in both cases.

Kind help would be appreciated.

Labels (1)
12 Replies

2,100 Views
urban_sharon
Contributor III

Sorry - I was working late on this... I accidently misinterpreted the situation and its not that the clocks misconfiguration was the source of the problem.

I was getting these faults:

BFARVALID (7) BusFault Address Register (BFAR) invalid flag

PRECISERR (1) Precise data bus error

And as it turns out, the usage of PRINTF statements copied from the sample code were the cause of all grief ;-(

0 Kudos

2,100 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Sharon,

I am sorry, I am not sure, did you solve your issue?

Regards,

Mario

0 Kudos

2,100 Views
urban_sharon
Contributor III

Yes thank you. I got the timer going now. And now I'm troubled with the next step - driving the ADC using the timer as hardware trigger. I get stuck when I set the IRQ up. Maybe I'll start a new topic on that.

0 Kudos

2,100 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Sharon,

Please look at the Temperature Sensor example that is working with the ADC.

Regards,

Mario

0 Kudos

2,100 Views
urban_sharon
Contributor III

The fault was due to misconfiguration of clocks

2,100 Views
urban_sharon
Contributor III

Thanks,

1. Still cannot activate PWM timer on top of WUART example

2. Cannot download reference source code from https://community.nxp.com/docs/DOC-345405 

0 Kudos

2,101 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Sharon,

It seems that we are getting some issues with our validation server. I will get back to you internally.

Regards,

Mario

0 Kudos

2,101 Views
urban_sharon
Contributor III

I managed to follow the guidelines in this link:

https://community.nxp.com/docs/DOC-345523 

However, as soon as I start the timer the device terminates the BT connection.

0 Kudos

2,101 Views
urban_sharon
Contributor III

I am trying to locate the call to the pins initialization function, generated by the pins config tool. In the PWM sample project (and other non BT related projects), this function is named BOARD_InitPins.

In the WUART sample project, I don't find such a call - and I wander who the pins are setup - I guess some settings are mandatory for the operation of the timer.

Also, I have tried to add a call to BOARD_InitPins and got a build error (even though I could go to the definition of the function in board.h)

0 Kudos

2,101 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Sharon,

The BOARD_InitPins is called in the hardware_init function in the board,c file.

For initializing the timer, please look at the led timer that is defined.

    /* allocate a timer for use in flashing LEDs */
#if gTMR_Enabled_d
    mLEDTimerID = TMR_AllocateTimer();
#endif

Regards,

Mario

0 Kudos

2,101 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Sharon,

I am not sure how are you adding or enable the PWM module, however, you have to create a task for enable it. The BLE stack is handling by an OS.

Please look at the next community post. De example is working on the QN9080, but the BLE stack is similar could provide a better reference of what you want.

https://community.nxp.com/docs/DOC-345405 

Please let me know if you have any issues with the example.

Regards,

Mario

0 Kudos

2,101 Views
urban_sharon
Contributor III

Thanks, I was however unable to download the code

0 Kudos