|
Currently looking at trying to port the code from the Make Magazine's "Pirate Radio" project [1] and this on the Orange Pi Zero H2 platform. I haven't done low level hardware in quite a while, so this should be fun...
This was originally done on the Raspberry Pi and can transmit in the FM frequencies (more infor here [2]). The most interesting part is here:
Next it sets the clock generator module to enabled and sets it to output on GPIO4 (no other accessible pins can be used). It also sets the frequency to 100.0Mhz (provided from PLLD@500Mhz, divided by 5), which provides a carrier. At this point, radios will stop making a "fuzz" noise, and become silent.
My hope is that becasue we have neither the GPU or NAND actively doing anything on the Orange Pi Zero, that this may be more possible than not without causing any disruptions on existing hardware. According to the H2 datasheet, the DDR control register can output between 200MHz and 2.6GHz, which is completely insane.
My thinking is to set PLL_AUDIO_CTRL_REG so that:
* PLL_ENABLE = 1 (enabled)
* LOCK = 0 for setting values, 1 for locking them in
* PLL_SDM_EN = 0
For the frequency, I think we want to aim as high as possible and then divide down to give ourselves the greatest possible control for the 100MHz range. Assuming `PLL _AUDIO = (24MHz * N) / (M * P)`, which I haven't decided yet.
* PLL_POSTDIV_P = ?
* PLL_FACTOR_N = ?
* PLL_PREDIV_M = ?
We can then use PLL_AUDIO as the source clock for something like I2S/PCM_0_CLK_REG. My hope is that maybe we can get some beeps over FM radio, I'm not yet convinced that there is enough control over clock speed to get something nice to listen to.
If we can't get something controllable in the 100MHz range, then perhaps it's possible to get something controllable in a harmonic on the target frequency, as we'll be producing square waves anyway [3].
There are some open questions:
1. I can't find any datasheets on the AllWinner H2, can it be assumed it operates mostly like the AllWinner H3? Does anybody know where one can get a spec?
2. Are there already some efforts to port this project?
3. Are there any reasons why this wouldn't be possible?
Any help is greatly appreciated!
[1] https://github.com/Make-Magazine/PirateRadio
[2] http://icrobotics.co.uk/wiki/ind ... o_an_FM_Transmitter
[3] https://en.wikipedia.org/wiki/Square_wave
|
|