Shop OBEX P1 Docs P2 Docs Learn Events
Virtual Peripheral and Basic — Parallax Forums

Virtual Peripheral and Basic

HaroldHarold Posts: 8
edited 2006-04-03 16:24 in General Discussion
I am interested in Virtual peripheral on the SX chips and wonder if people are currently using them and are they accessible/compatible with code written in BASIC for the SX chips?

Comments

  • BeanBean Posts: 8,129
    edited 2006-04-03 11:21
    Harold, I'd say that "most" VPs could be written in SXB.
    What type are you interested in ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
    Product web site: www.sxvm.com

    Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • HaroldHarold Posts: 8
    edited 2006-04-03 15:12
    I am looking to write an a/d converter, rs232/bluetooth and rtc. I didn't see a lot in the forums on vps so I was wondering are they still a good idea and are they being used by the community
  • RsadeikaRsadeika Posts: 3,837
    edited 2006-04-03 15:29
    The only prog that I have seen, that is·close to being a VP, is in the SX/B examples folder, it's a read only (Rx)·UART. All other VPs are in asm, go to the Parallax.com download area and you will find the main VPs there. As for the A/D, in the Al Williams book, he has an example, of course it is in asm, but it is simple enough that you may be able to re-create it in SX/B (inline asm). I have been trying to dabble in this for quite some time, and it is not easy going.

    Ray
  • BeanBean Posts: 8,129
    edited 2006-04-03 16:24
    If you talking about the bitstream A/D then all you really have to do in the interrupt is:

    · IF counter > 0 THEN
    ··· value = value + InPin
    · · OutPin = ~InPin
    · · DEC counter
    · ENDIF


    and in the main code to this to get a reading:


    · value = 0
    · counter = 255
    · DO
    · LOOP UNTIL counter = 0
    · ' value holds the a/d value

    I haven't tried it, but that should get you started...

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
    Product web site: www.sxvm.com

    Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
Sign In or Register to comment.