Shop OBEX P1 Docs P2 Docs Learn Events
Barebones SX Example Schematics? Or help with required components — Parallax Forums

Barebones SX Example Schematics? Or help with required components

ClintClint Posts: 95
edited 2007-12-01 02:39 in General Discussion
Where can I find example circuit diagrams using the SX28?

Currently I am·prototyping using an SX Tech board and SX-key to program an SX28 DIP using SX/B. I'm powering it with a 9V adaptor. I don't have a resonator in the oscillator socket (nothing connected to Osc1 or Osc2) and it reads the encoder fine. I take it this means the internal oscillator is fast enough? My program has:

DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, PROTECT, BOR22
FREQ··········· 4_000_000

Now I'd like to transition to a battery powered·circuitboard.·I'm not sure what components I absolutely need to make my SX28 function. I'd like to power it with a 9V battery. All I'm doing is·reading an encoder and displaying the results on a 7-segment display.

I have found lots of programming info here, but I'm not sure where to look on best practices for wiring one of these.

Any help is appreciated, even if it's just a link to where I should look for the info. smile.gif
Thanks,
Clint

Post Edited (Clint) : 11/21/2007 3:05:20 AM GMT

Comments

  • ZootZoot Posts: 2,227
    edited 2007-11-21 03:45
    Start with the schematic for the SX Tech board.

    If you are not using an external clock source, there's not much:

    +9v -> +5v regulator (again, use the schematic from any Parallax bread- or proto-board).

    +5v and GND to Vdd and Vss

    .1uf cap between Vdd and Vss pins, close to the chip

    +5v -> 10k -> /MCLR (pullup on reset, button to ground is optional)

    +5v to RTCC if you are not using external interrupt

    OSC1, OSC2, Vdd, Vss to 4pin header for connecting SX-Key or SX-Blitz

    If you wire in a 3-pin SIP socket, you can put in (or take out) a resonator. It's easier to wire it in and not use it, then to need it and have to add it later. But I often leave the SIP off projects that I know will not run above 4MHZ to keep things simpler, cheaper, faster.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2007-11-21 04:38
    Another great place to get examples is the Nuts'n'Volts articles on the BASIC Stamp and the SX series chips:

    http://www.parallax.com/Resources/NutsVoltsColumns/tabid/272/Default.aspx

    In particular there are quite a few recent ones written by JonnyMac which use the SX28 chip. They are very well written and should help.

    One thing to keep in mind when looking at any schematic using the SX28 is to check the package style used! The pinout is slightly different between the surface mount version and the DIP version of the chip.

    Good luck,

    Robert
  • PJMontyPJMonty Posts: 983
    edited 2007-11-21 06:07
    Clint,

    Since you're planning on a 9v battery powere supply, take a look at this thread:

    http://forums.parallax.com/showthread.php?p=604054

    Lot of good info regarding that issue.

    Thanks,
    PeterM
  • ClintClint Posts: 95
    edited 2007-11-22 16:55
    Thanks all for the help. Zoot I thought it might be that simple, but I wasn't really sure. I'm not much of an electronics guy; I just know enough to get myself into trouble!

    As far as power management goes for saving battery life, are there common ways to:
    1. Put the SX and possibly other powered accessories into a sleep mode when left idle for a period of time and
    2. Detect a low battery and use this to turn on an LED or other indicator before powering off

    I'm having a hard time finding things on the Parallax website. Where do I look for a schematic for the SX Tech Board?
  • ZootZoot Posts: 2,227
    edited 2007-11-22 17:11
    1. Yes. The SLEEP command on the SX puts it in low power mode. It can be waked by a reset or using an external interrupt on Port B. Powering down external circuitry in software is doable, but takes some more work (e.g. you can tie an output pin of the SX to a transistor, which in turn provides power to external circuitry so that the SX can turn things on and off -- do a search at the forums, there are a number of examples floating around)

    2. Yes. You could use the comparator on RB to do this.

    Goto parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/399/List/1/Default.aspx?SortField=ProductName,ProductName

    It's the protoboard, but schematic is essentially the same. You'll see a link there to download schematic and manual.

    Happy Thanksgiving! Time to eat pie!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    Post Edited (Zoot) : 11/27/2007 8:06:12 PM GMT
  • NetHogNetHog Posts: 104
    edited 2007-11-27 17:55
    I got bit by this, I hooked up the SX28 and the SX-Blitz, and was getting errors. I touched the chip and noticed it was very hot and immediately disconnected it. Took me a few times to realize I was looking at the surface-mount device for pin-out. Still, I think with me being quick to check the temp of the chip (a sure indicator something is wrong) and the resilience of the SX28 chip, I didn't damage it in any noticable way.

    (I caveat 'noticable way' since I know I stressed the chip out)
    RobotWorkshop said...
    Another great place to get examples is the Nuts'n'Volts articles on the BASIC Stamp and the SX series chips:

    http://www.parallax.com/Resources/NutsVoltsColumns/tabid/272/Default.aspx

    In particular there are quite a few recent ones written by JonnyMac which use the SX28 chip. They are very well written and should help.

    One thing to keep in mind when looking at any schematic using the SX28 is to check the package style used! The pinout is slightly different between the surface mount version and the DIP version of the chip.

    Good luck,

    Robert
  • ClintClint Posts: 95
    edited 2007-11-29 19:32
    Thanks for the input! Zoot, I especially appreciate the links. That is helpful!

    New question:
    For SPST switches (buttons) used for inputs, is there a way to use the SXs internal pullup resistors on the input pins to eliminate the need for external resistors? What is a good programming strategy for handling a simple input switch to perform a function once per push? Are there any good examples of this?

    Thanks for your help!
  • ZootZoot Posts: 2,227
    edited 2007-12-01 02:39
    Yes, the input pullups on the SX are perfect for this. They are "weak" pullups, btw..if you need really strong pullups (like for i2c) you'll need external resistors.

    In SX/B it's:

    MyPin PIN RB.0 INPUT PULLUP

    You can also set them in ASM by using the mode and option reg, and you can use the SX/B PLP aliases to change them during runtime. It's also a good idea to turn them on for any unused pins.

    For buttons it's mostly a questions of how many and if you are debouncing or not. You can check out a good write up and some snazzy code for monitoring 4 buttons on RA in the Nuts n Volts 142 -- Game of Life for the SX by Jon Williams (aka JonnyMac). Most of his N/V columns over the last 9 months or so (?) have been about the SX and mixtures of SX/B and ASM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.