Hello! I am putting (with a wave generator) a square wave on pin 17 of the microcontroller, and I want that same wave to come out on pin 18. How do I do that? Do you have any specific commands? Thanks
Hello! I am putting (with a wave generator) a square wave on pin 17 of the microcontroller, and I want that same wave to come out on pin 18. How do I do that? Do you have any specific commands? Thanks
Hello B
There are a couple of ways to do this, but I believe the one with the smallest latency is using GPIOTE to sense the high-to-low or low-to-high transition on the input pin, and make that cause a change in the output pin via PPI. This will allow the input pin to change the output pin without the processor core being involved (no handler execution).
I have attached a main file illustrating the concept, it is a rewritten version of the peripheral template from SDK 12.3.0 for the PCA10028, and should work by just replacing the template code with it.
It uses the high accuracy GPIOTE event (toggle, created by pressing button 1) to trigger a GPIOTE task (toggle on LED1) via PPI.
Best regards
Jørn Frøysa
Thank you so much for your help! I tried to do what you said, but it did not work. In fact, it would be more simple than you explained me. I'm putting (a wave generator) a square wave on pin 17 of the microcontroller, and I want that same wave to come out on pin 18. How can I do that? Do you have any specific commands?
What is the frequency of the PWM? Is there a particular reason you need to recreate the PWM at the output of the nRF?
The frequency is 200Hz In fact I would like to see how the micro reads this signal, so it would put an oscilloscope on the output pin to see.
Well, there is no way you can connect two pins internally directly, so you will need to recreate the PWM signal somehow. I believe the code I posted should be capable of doing what you need. How did you configure it? You need to change the pin numbers to match yours. Is any of your other code using any PPI channels?