Shop OBEX P1 Docs P2 Docs Learn Events
SXB I/O port definition — Parallax Forums

SXB I/O port definition

KenMKenM Posts: 657
edited 2005-06-20 16:33 in General Discussion
Is there a mistake in the declaration of RB & RC I/O ports in the SXB code example for digital dice?
Below is a code snippet copied from the the SXB·example for digital dice.
If I correctly interpret the schematic, all RB and RC port pins should be outputs, yet not all of the ports are configured the same, yes/no?
Is there a mistake in the declaration of I/O ports·or am I missing something?
Thanks.
Ken

Start:
  TRIS_B = %10000000                            ' make LED ports outputs
  TRIS_C = %10000000


Post Edited (KenM) : 6/18/2005 5:06:30 PM GMT

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-18 17:22
    SX/B uses SX conventions for declaring IO pins; that is, a "1" bit is an input, a "0" bit is an output.· I wrote and ran that code, and can assure that it does indeed work.

    PBASIC uses a shadow register called DIRS to set the IO pin state; it is an inverted version of TRIS.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 6/18/2005 5:25:07 PM GMT
  • KenMKenM Posts: 657
    edited 2005-06-18 17:42
    Thanks Jon,

    I should have seen/realized that·ports RB.7 and RC.7 have nothing connected to them and are left at floating inputs.

    The Stamp community is·going to suffer a little (ok, a lot) after·you move to LA and·"land that gig," become a movie star and won't have time for·Stamps......

    Ken·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-18 17:48
    Nope -- my agreement with Parallax is that no matter what happens in my "other life" as an actor, I will always remain a Parallax employee (so long as I don't do something really stupid and get tossed out on my can....). BASIC Stamps have been a part of my life -- and every single day of it -- for the last 12 years; I will always find time "in my trailer" to experiment.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BeanBean Posts: 8,129
    edited 2005-06-18 18:51
    It's good to have a "double life".
    I work with the SX and programming, but I also enjoy playing guitar and singing (well trying to sing) in jam sessions.
    It's like a complete opposite and get's my mind off of programming stuff.
    That's what you need, if you think "programming" 24 hours a day it will start to get to you after awhile and you'll burn out quickly.
    Now if I can just get my wife to believe that I have "A" life [noparse];)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "What's the difference between ignorance and apathy ?"
    "I don't know, and I don't care."
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-18 19:43
    If you ever come visit our office you'll have to bring your guitar. John Barrowman and I (Team EFX -- www.parallaxefx.com) and Paul Bouchard in Sales all play and sing to one degree or another.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-06-18 22:37
    Hey you guitar pickers / singers at Parallax - looks as if you are almost complete founding a new band... Too bad that I'm living at the "other side of the world". I have a Gibson Les Paul guitar here plus a nice amp to make it scream like hell. But my favorite instrument is the Hammond organ, so I also do have a B3 with a 174 Leslie here in my home. Unfortunately, this stuff is too heavy to be taken to a gig. Therefore, I decided that I'll play a piccolo flute in my next live, because this one fits into even the smallest pocket.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-18 23:46
    Jon Williams (Parallax) said...
    If you ever come visit our office you'll have to bring your guitar. John Barrowman and I (Team EFX -- www.parallaxefx.com) and Paul Bouchard in Sales all play and sing to one degree or another.
    Hey,

    ·· Let's not forget the Tech Support guy who plays Drums, Keyboards and sings a little, and has done work ona· few albums, including one still in the works.· =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • BeanBean Posts: 8,129
    edited 2005-06-19 01:00
    Hmmm,
    I wonder if there is a connection between "technical" people and music ???
    Or is it just that many many people play instruments ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "What's the difference between ignorance and apathy ?"
    "I don't know, and I don't care."
    ·
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-06-19 02:53
    Bean,

    I can't play a stitch.... that's why in the past I have played the part of the "electronic rodie" <- John, Jon, and Chris don't get any ideas
    that's a lot of work for one dude to handle, especially when things don't go exactly right sometimes. - grin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • BeanBean Posts: 8,129
    edited 2005-06-19 15:22
    Beau,
    I'm into sound also. I have a 16 track digital recorder, and PA system and all that jazz.
    I figured since I can't sing that well I might be able to "do" sound for people that can.
    I've recorded several demo CDs for some people.
    But now with a 18 month old son, I barely get time to play at all.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "What's the difference between ignorance and apathy ?"
    "I don't know, and I don't care."
    ·
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-06-19 21:59
    Bean,

    in my opinion, writing software, or designing a new electrinic circuit is very similar to composing or performing music - both is creative and artwork. Maybe this is the reason why many programmers are also musicians - at least I met many people like this in my live so far.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • James NewtonJames Newton Posts: 329
    edited 2005-06-20 05:54
    Given the apparent level of interest in music within our little SX community, why are there not more audio related designs published?

    The SX is a natural for all sorts of DSP and related projects. Yet only the bare basics have been published:
    http://www.sxlist.com/techref/ubicom/lib/math/dsp/index_sx.htm

    I'm very interested in that area as well. The last newsletter was about sine wave generation.
    http://www.sxlist.com/techref/new/letter/index.htm and an upcomming edition will be about filters. Sometime in the future I hope to do one about speech synth.

    Some ideas:
    • SX drum machine
    • SX Reverb
    • SX midi encoder (frequency to midi note conversion)
    • SX emulator of any of the old video game sound effects chips which (I understand) are hard to find.

    And here is a crazy thought: Would it be possible to decode low bitrate MP3 data directly in an SX? Without using an external MP3 decoder?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james@sxlist.com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-06-20 08:58
    James,

    yes, you are right, there are not very many music related SX designs around, except the MIDI applications Jon did.

    As a metter of fact, my first SX applications were control panels for electronic organs. All of them communicate via an I²C bus using MIDI data. I have developed different types of panels, one with 64 push buttons and LEDs, another one with 16 drawbars (potentiometers), and one with pushbuttons, LEDs, and an incremental data wheel.

    I remember an article in BYTE many many years ago where they pusblished code for the KIM-1 board (with 6502 processor) which made the board play songs in four voices with just a simple R-2R-ladder DAC connected to a port. This one was clocked at 1 MHz, so it should be easy to do something similar, and much more with an SX @ 50 MHz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    Günther
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-20 09:20
    For audio, there is a project playing wav files from MMC:
    http://www.sxlist.com/techref/ubicom/contest/52wavmmc.htm

    regards peter
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-20 16:33
    James Newton said...

    And here is a crazy thought: Would it be possible to decode low bitrate MP3 data directly in an SX? Without using an external MP3 decoder?

    This thought has crossed my mind as well, I have downloaded an open source mp3 decoder, but thats about as far as Ive taken the idea.· Finding (or deriving) a fast implementation of the IDCT for a 8 bit micro would be key to implementing it.
Sign In or Register to comment.