Shop OBEX P1 Docs P2 Docs Learn Events
RF VFO Project — Parallax Forums

RF VFO Project

ChrisSChrisS Posts: 2
edited 2010-05-14 09:35 in BASIC Stamp
Has anyone written BS2 code to read a two output serial encoder and control a DDS-60 frequency synthesizer?· Edwards wrote an article in Nuts and Volts entitled "Rotary Encoders Help You Program A FRiendly Spin and Grin Interface".· However, the code is for the BS1, while I am using a BS2SX.· What command do I use to replace 'PINS'|?· Since·all variables are defined differently, how does one handle Bytes?· Do I use INS and IN0-IN15 to replace Bit0?·

Seems like no one in the Amateur Radio community have done this.· They have all gone to PICs or other chips programmed in C or assembler.

Thanks for your help.



··

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-05-11 16:34
    Seems to me in the help file that comes with the stamp editor there is a section on the differences between bs1 and bs2 code. You might look at that for starters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • hover1hover1 Posts: 1,929
    edited 2010-05-11 16:55
  • Larry~Larry~ Posts: 242
    edited 2010-05-11 18:01
  • ChrisSChrisS Posts: 2
    edited 2010-05-14 09:35
    Gents - Thanks for your input. I was finally able to read the rotary encoder by substituting the INS Word Name for PINS and using .HighByte and .Lowbyte to get the first and last digits of the new and old dial settings. Then it was simply a matter of using XOR to get direction.

    But doing the calculations for actually calaulating the synthesizer frequency is a little more problematic, as the BS2SX only does 16 Bit arithmetic. Guess my options are:

    1. Get the 32 Bit coprocessor (But how does one modify P Basic 2.5 to use the larger strings?)

    2. Write my own double precision routines (But I am not a mathematician!)

    3. Use a look up table ala Wade Lake KR7K

    Guess the third choice is the most viable, although I will have to recalculate the table as the new synthesizer, an AD 9851 uses a 180 MHz clock.

    The NJQRP does tell you how to use Serout to set frequencies, but it is only after you get the hex string from the Analog Devices design tool! Now I see why few people have used Basic Stamps in this application!

    Cheers

    Chris W1EH
Sign In or Register to comment.