Shop OBEX P1 Docs P2 Docs Learn Events
Hook an antenna to your Propeller, and listen to the radio! (New shortwave prog - Page 8 — Parallax Forums

Hook an antenna to your Propeller, and listen to the radio! (New shortwave prog

1234568

Comments

  • madrfskillsmadrfskills Posts: 24
    edited 2011-05-23 14:19
    Using a quenched oscillator makes this a super regenerative receiver. A RF buffer amplifier between the oscilator and the aerial will cut down on the radiated bursts.

    Quite right, Toby - its a super-regenerative. Very, very silly of me to mistype like that!

    Either -

    1) Built a superhet with the daughter and my mind is clogged, or
    2) I've been drinking too much, or
    3) I've been drinking too little

    Cheers!
    Mike
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-05-23 14:55
    Too much ? Too little ???

    One should always maintain a balanced diet. Never eat on an empty stomach.
  • Cluso99Cluso99 Posts: 18,066
    edited 2013-07-10 18:55
    Over on the P2 forum a question about SDR was asked. So just to bump this thread again.
    BTW perhaps using a cheap DVB-T dongle (with the RTL2832U chip) and the prop could work together?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2013-07-11 01:49
    I was deep in the dreaming of a general coverage RX using a TV tuner head and Prop when I saw the SDR# project. For £12 I had a EZCAP RX head that nominally goes from 50MHz - 2GHz (with a hole around 1.1GHz). It is not that great on sensitivity but that gives me something to do with pre-amps / filters etc. There are a ton of birdies too, but hey, £12 (inc p&p Deal Extreme). I believe that it is only the ones that have the radio option as well as the TV that are of any use.

    With all of the bandwidth over USB2 and 0.9 - 2MHz BW it wouldn't run on a P4 2.5GHz 400FSB board, the nice guys at SDR# even compiled a version that did 250KHz BW for me. On a 2.8GHz but 800MHz FSB the 2MHz system runs at 60 -70 CPU.

    The waterfall and other bits could be dropped off of the workload but there is a lot of maths, and a USB2 interface.
  • tingotingo Posts: 87
    edited 2013-07-12 05:32
    Which EZCAP dongle is that? Is it one of the RTL2832 dongles?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2013-07-12 07:31
    I have lost/thrown the box but I am sure that it was this one, which does use the RTL2832 -

    Ezcap EZTV645 DVB-T Digital TV USB 2.0 Dongle with FM/DAB/Remote Controller at the bottom of http://dx.com/s/ezcap

    I think that there are others that would run but it would be wise to check that they are on the approved lists.

    Windoze will not report what it is as you have to use the ZADIG drivers, Windoze bleats about it not having a bulk endpoint ...

    I must see what the latest versions of SDR# have on them, I am using one from about a year ago. I was so grateful for then making a version that could limp along on the 2.8G P4, that I was trying to get going for my father, that I stuck with the first one that ran properly (with too much BW the CPU went to 101% and froze up) .

    Sod's law made it that just as I was getting somewhere, his eyesight gave up.
  • tingotingo Posts: 87
    edited 2013-07-31 06:30
    Yeah, I already have another RTL2832 device. Thanks for telling which version you used.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2013-07-31 12:17
    I should warn people that I got hold of another (free) EZCAP dongle. That one is nowhere as good as the first one, it receives but is not as sensitive (not that good in the first place ) and gets blown off the face of the earth by anything local. I live 300m under a flight path and there a loads of pager base stations blasting away, somewhere about here too. So 100 - 150MHz region is a bit busy/hostile.

    But hey, they are cheep.

    Back on thread:- I did try the Prop RX stuff but only with 40DIP ones, I really must try it with the new one pin DAC.
  • LEE MLEE M Posts: 1
    edited 2013-11-28 09:05
    Wow you guys are like geniuses. I have a prop and an ADC MCP3208 and I'm trying to MEASURE the amplitude of all the frequencies from 6 meg to 40 meg. I don't need accuracy but PRECISION. I can follow your code, somewhat, and the frequency cycling is EXACTLY what I am looking for... now I am just trying to figure out how to introduce the ADC into the mix and get some measurements from it all. I REALLY appreciate any assistance any of you could render as this has the potential to help my crew beyond imagination. Thank you.
  • SeairthSeairth Posts: 2,474
    edited 2014-05-01 04:19
    I was looking through the code and came across the following block:
    :mix          waitcnt   time,sample
                  mov       i_samp,phsa
                  mov       phsa,#0
                  mov       q_samp,phsb
                  mov       phsb,#0
    

    I suggest the following code instead:
    :mix          waitcnt   time,sample
                  mov       i_samp,phsa	' capture both PHSx back-to-back
                  mov       q_samp,phsb
                  sub       phsa,i_samp	' Use SUB instead of MOV #0 to keep any
                  sub       phsb,q_samp	' accumulation in the past 4-8 cycles
    

    Unfortunately, I have not yet set up this project, so I can't tell if this makes any practical difference to the sampling/mixing.
  • kuronekokuroneko Posts: 3,623
    edited 2014-05-01 04:31
    Seairth wrote: »
    :mix          waitcnt   time,sample
                  mov       i_samp,phsa	' capture both PHSx back-to-back
                  mov       q_samp,phsb
                  sub       [COLOR="#FF8C00"]phsa[/COLOR],i_samp	' Use SUB instead of MOV #0 to keep any
                  sub       [COLOR="#FF8C00"]phsb[/COLOR],q_samp	' accumulation in the past 4-8 cycles
    
    Accumulations are not reflected in shadow[phsx].
  • SeairthSeairth Posts: 2,474
    edited 2014-05-01 18:56
    kuroneko wrote: »
    Accumulations are not reflected in shadow[phsx].

    For d-field, the shadow register is read instead of the actual PHSx register? Huh. I did not know that.
  • mstrammstram Posts: 49
    edited 2016-05-02 10:00
    Could an indoor digital t.v. antenna be of any use with this radio?

    I have an RCA "cant585 antenna", haven't found any specs for it.

    And I don't want to take it apart, I need it for my t.v. ;)

    Also I don't have the 10M resistor or 500uh coil yet, I've tried some substitutions with what I have available, but so far am only
    "receiving" static.

    How far "out of spec" for those two components would the radio be expected to work at all?

    I'm in Toronto (Canada), and there are an abundant supply of a.m. stations nearby.
  • Phil,

    RCA ANT550F

    This tiny signal is presented to pin A3 of the Propeller via a capacitor. Also connected to A3 is a 10 megohm resistor from A4.

    A counter is configured in feedback mode (normally used for sigma-delta ADC), which reads pin A3 and, at the next clock interval (12.5ns later) outputs the opposite signal (i.e. 0 -> 1 and 1 -> 0) to A4. This "negative feedback" will tend to keep the signal on A3 centered on Vdd/2, which is the Propeller's digital input threshold. But, becasue the feedback resistor is so large, and because there's residual capacitance between the Propeller's pins and ground, the effect of the A4 output on A3 won't be instantaneous.

    So if the signal coming in on A3 goes very high, it may take several clock periods for a low on A4 to bring it back down. So, the higher the signal on A3, the more 0s we'll see on A4; and the lower the signal on A3, the more 1s we'll see on A4.

    How did you calculate the value of the 10 Mohm resistor ?

    I don't have a resistor that big (yet), and have been trying to use ~1M ( 4 x 400k), without (probably obvious to you) success.

    Can any adjustments be made to the code to compensate for the smaller resistor ?

    All I'm hearing is a ~1hz pulsating tone which may be just the serial port noise ?

    I'm also trying to connect pin 3 & 4 to the resistors via an external breadboard, is that another "guaranteed" failure ?

    Mike

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2016-05-10 05:37
    The 10 M resistor was chosen to present the highest impedance to the feeble signals possible. It should be soldered directly to the pins of the Prop, and a surface-mount resistor is preferable. Connecting it via an external breadboard is definitely a prescription for failure.

    -Phil
  • The 10 M resistor was chosen to present the highest impedance to the feeble signals possible. It should be soldered directly to the pins of the Prop, and a surface-mount resistor is preferable. Connecting it via an external breadboard is definitely a prescription for failure.

    -Phil

    I understand (basically) the reason why you chose a high value resistance.

    To rephrase my question : what numbers / values / formulas from the prop datasheet, and your project specification did you use to arrive at 10Mohm?

    If I was looking at the prop datasheet, I would have no clue what value of resistor would "present the highest impedance".

    If a 10Mohm (high) is good, then why not 1Ghom ? ( I guess it's not just a simple "more is better") ?

    Is it that anything more than 10Mohm has a negligible (or even adverse) effect on increasing the impedance ?

    Mike

  • ... <snip>
    This tiny signal is presented to pin A3 of the Propeller via a capacitor.

    Also connected to A3 is a 10 megohm resistor from A4.

    A counter is configured in feedback mode (normally used for sigma-delta ADC), which reads pin A3 and, at the next clock interval (12.5ns later) outputs the opposite signal (i.e. 0 -> 1 and 1 -> 0) to A4. This "negative feedback" will tend to keep the signal on A3 centered on Vdd/2, which is the Propeller's digital input threshold. But, becasue the feedback resistor is so large, and because there's residual capacitance between the Propeller's pins and ground, the effect of the A4 output on A3 won't be instantaneous. So if the signal coming in on A3 goes very high, it may take several clock periods for a low on A4 to bring it back down. So, the higher the signal on A3, the more 0s we'll see on A4; and the lower the signal on A3, the more 1s we'll see on A4.

    If we were using this counter as an ADC, we could set its FRQx to 1 and let it count the number of 1s it sees on A3 in a given interval. This count would be proportional to the average signal strength on A3 during that interval. But we're not going to do that. Instead, all we need is that string of 0s and 1s on pin A4. This is shown as signal "ADC" in the middle of the attached image, in magenta. If you squint your eyes, you can almost make out the sinusoids (inverted) from the modulated signal, even though, at each instant, A4 is either high or low.

    Two additional counters are used to form the square wave signals I and Q, shown in blue and green. These signals have the same frequency as the carrier, which is how we tune the radio. They are 90° out of phase from each other, though, and have an unknown phase relationship with the incoming carrier.

    Now, here's where the magic happens. We can take the ADC bitstream from A4 and /XOR (/XOR is the same as the equality function) it at every step with I & Q to produce two resultant bitstreams (shown above I and below Q on the graph). If the carrier happens to line up with I (i.e. if it's in phase with I), more high points than low of ADC will coincide with high points of I, resulting in an abundance of highs after the /XOR; and more low points than high of ADC will coincide with low points of I, again resulting in an abundance of highs after the /XOR. The opposite happens when the carrier and I are 180° out of phase. But in both cases, the number of highs and lows will be at an extreme from the norm, which is a 50% duty cycle.

    On the other hand, if I is 90° out of phase with the carrier, in either direction, the highs and lows will balance out, and their number will be about equal after the /XOR. The reason for having two "local oscillator" signals, I and Q, is so we don't have to rely on just one being in the right phase with the carrier. If one is nearly in phase or 180° out of phase, the other will be closer to 90° out of phase. Moreover, we can combine the outputs of the two /XORs in such a way that the result is completely independent of the carrier's phase.

    ... <snip>............

    Once we have the sample counts from the /XORed I and Q, we subtract the average count (i.e. half the sampling interval) from each and square the result. Then, we add the squared values and take the square root of the sum to get the "root mean square" (RMS) amplitude of the incoming radio wave at the chosen frequency. This amplitude is a discrete sample (shown in red at the bottom of the illustration) of the original audio signal (shown in red at the top).

    Is there a name for the demodulation technique you've used here ?

    Or is it a combination of various d.s.p. processes ?

    Mike

  • mstrammstram Posts: 49
    edited 2016-05-10 09:40
    I've recently gotten enthused about ham radio (again) and built a proper antenna for the amateur HF bands to go with a new transceiver. So I thought I'd give the Prop radio a try on shortwave, using the antenna.

    <snip>
    This feeds the antenna input to the original AM receiver circuit on page one. I modified the quadrature generation software to use the counters' PLL mode automatically when the receive frequency is high enough. The new program is attached below.

    Listening on the lower end of the 20-meter ham band, I was able to detect CW signals. Granted, they weren't as loud as they were in my new transceiver, but they were loud enough to copy. I suspect that I have a severe impedance mismatch between the 50-ohm antenna feed and the RF amplifier input. Perhaps, if I can figure out how to correct it, I'll get better reception.

    -Phil

    I see in your code you've limited the frequency scan from 14_000_000 to 14_050_000. (the 20m band)

    Given a proper antenna, would your code / the propeller work to receive 1_800_000 to 30_000_000 ?

    I.e. just by changing the " 'repeat frequency from 14_000_000 to 14_050_000 step 500" to

    ' repeat frequency from 1_800_000 to 30_000_000 step 500 ?

    (or some portion of the above ... e.g. 7_000_000 to 7_300_000 ... etc)



    Mike

  • To rephrase my question : what numbers / values / formulas from the prop datasheet, and your project specification did you use to arrive at 10Mohm?

    10 M was the highest value I had on hand, so that's what I used. IOW, no engineering, just guesswork.
    Given a proper antenna, would your code / the propeller work to receive 1_800_000 to 30_000_000 ?

    Yes.
  • Has anyone here got this to work WITHOUT soldering a resistor to their prop ?

    I have neither the skill, equipment or desire to solder to my only quickstart ;)

    I'm thinking of buying a prop-project board, is anyone using one for this radio and placing the resitor -pin3-pin4 connections on it's
    built in breadboard / pin area ?

    Mike
  • Phil,


    I built your circuit, and used a 500uH coil instead of a 330uH (1.73K to 5.03K impedance) ... I also used a 10Meg resistor for the ADC instead of the 470K resistor. This helps
    to provide less loading on the antenna from the feedback I/O pin, allowing weaker signals to be picked up.

    With 22 gage solid wire, I used a 6-foot piece of it for my antenna.

    The attached wav file is the result from a radio station a little more than 9 miles from my home.

    Holy ..smoke ! ;)

    I just downloaded Beu's wav file.

    Has anyone else gotten similar results ?

    I still haven't built a proper circuit, but Beu's result has inspired me to do so !

    Mike

  • I have read through the thread and have not found the link to download the code for the AM radio. Can someone please provide the link or point me in the right direction of where I may obtain the code? Thank you.
  • TheTech69 wrote: »
    I have read through the thread and have not found the link to download the code for the AM radio. Can someone please provide the link or point me in the right direction of where I may obtain the code? Thank you.

    The ZIP file is at the bottom of the first post, to the right of the schematic. It's hard to pick it out next to a graphic.

  • Thank you very much, sir!!
  • Martin_HMartin_H Posts: 4,051
    edited 2017-10-27 20:57
    I read through this entire thread and it is a neat project. But suppose you wanted to take this to the next level, and use it to scan a broad range of frequencies. This raises a set of related questions:

    The wound coil restricts this radio to a specific band (e.g. AM BC), but software defined radios scan multiple bands. Looking at the block diagram for such a radio it simply states "flexible RF hardware". But in practice how does this work? Do you put taps on the coil and switch between bands programatically?

    Alternatively, to reach higher frequencies you could use a hardware mixer (e.g. the ne602) to mix the signal down to an IF, and use the Propeller as the IF portion of a superheterodyne receiver. However, this would require a VFO controlled by the Propeller as the local oscillator. There are chips than can do this, but the Propeller could generate an output square wave. Would there be a way to low pass filter it, or multiple counters and a resister DAC?

    Note that my radio electronics skills aren't the best, but I have managed to build a few radios that worked halfway OK.
  • The NE602 has a built-in local oscillator. One way to tune it from the Prop would be to include a varactor in the oscillator's LC tank circuit and use the Prop's filtered DUTY-mode output to tune the varactor. The output of the local oscillator would be fed back into the Prop, which would compare its frequency to the desired frequency so it could make corrections to the varactor tuning. This comprises a digital frequency-locked loop (DFLL). The nice part about this, which I've tried, is that the local oscillator puts out a nice sine wave, instead of a square wave that's rife with harmonics.

    -Phil
  • That is a really good idea. I built a Ramsey direct conversion receiver kit that uses an ne602, but the stability of the Colpitts oscillator is poor. I can tune SSB, but oscillator drift makes it unlistenable pretty quick. Moreover the tuning pot (driving voltage across a varactor) isn't linear, so lots of luck compensating.

    Having feedback from the Propeller would improve it. I might have time to try it this weekend. I would still face the issue that the tuning range is limited by the capacitors in the oscillator, but I could face that later.

    If I do this I may start an alternate thread to avoid cluttering up this one.
  • It's not as easy to get high-capacitance varactors as it used to be. A lot of the favorites for MF and HF tuning have been discontinued.

    -Phil
  • Is that because direct digital synthesis made them unneeded?
Sign In or Register to comment.