Tiny Core Base > Raspberry Pi

Turning the Raspberry Pi Into an FM Transmitter

<< < (3/4) > >>

Rich:
Hi Paulo
I imagine that the transmit frequency gets updated at a periodic rate, so it would probably make sense to measure
the duty cycle during that time. By using a reasonably high frequency for the PWM, say 100Khz, you could poll
the GPIO pin to make the measurement. At that frequency, a measurement would take 15uS. worst case. You
would need to disable interrupts during that time, and have a way to abort the measurement and re-enable the
interrupts should the PWM stop running.

Paulo:
Hi Rich


--- Quote ---You would need to disable interrupts during that time, and have a way to abort the measurement and re-enable the
interrupts should the PWM stop running.
--- End quote ---

How does one do this with Linux?
Plus if one had to disable interrupts in one app, would the kernel honour that system wide?
The last time I messed with interrupts was using ASM in a pure dos environment.
I don't mind using X86 ASM, but the ARM instruction set is still new to me.

Rich:
Hi Paulo
For a possible example for Pi, check out:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=7696
He posts the source code here:
https://github.com/richardghirst/Panalyzer
The  pandriver.c  file shows him using  local_irq_disable()  and  local_irq_enable().

Paulo:
Nice find, thanks Rich.

Rich:
Hi Paulo
You are welcome.

 @bmarkus: Do you feel we are getting off topic here? If so, Paulo can start a new thread with further questions.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version