Shop OBEX P1 Docs P2 Docs Learn Events
Help needed selecting SX chip for my project. — Parallax Forums

Help needed selecting SX chip for my project.

SamWSamW Posts: 27
edited 2009-06-04 23:03 in General Discussion
I wanted to use the SX chip on my PDB to complete a project.· I have been using the BS2p40 and it is my understanding that I will have to change this to something like the BS2.··
·
Will the SX chip work with the BS2?· I want to use both microcontrollers simultaneously so I was hoping to have the BS2 control my sensors and data acquisition.· I need the SX to perform one specific function in four different ‘states’.
·
I want to use the SX to generate a sine wave that will ultimately be used, after being manipulated in a separate control system, produce different vibration frequencies on a large inductive device.·
·
I plan to have the SX simply produce a sine wave at a predetermined frequency.· Specifically I would like to have it produce 50 Hz, 60 Hz, 70 Hz, and 90 Hz.· There will be four switches that control when the signal is produce.· I saw that on the downloads page there is an article “Artificial Sine Wave Generation Using SX Communications Controller”.
·
Will I be able so do something like this with the SX microcontroller officered by parallax?
·
If so which SX chip will I need?
·
Any insight would help, can someone please help?
·
·

Comments

  • JonnyMacJonnyMac Posts: 9,213
    edited 2009-06-01 21:32
    The SX will work for you and the best part of the PDB is that you can do all of your development right on it. I do lots of BS2-to-SX projects and the PDB makes this very simple.

    For a recent project with a friend we used the SX to create sine waves; the code looped through a table of sine values and wrote these to one of the ports with an R2R network -- worked really well and was easy to do.

    Post Edited (JonnyMac) : 6/1/2009 9:37:35 PM GMT
  • PJMontyPJMonty Posts: 983
    edited 2009-06-01 22:29
    SamW,

    I doubt you even need the BasicStamp for your project. The SX should be able to generate the sine waves plus handle data acquisition all by itself. Getting two chips to talk to each other in a master/slave arrangement is probably as much work as getting the SX to do the whole job alone. Give it a shot!

    Thanks,
    PeterM
  • SamWSamW Posts: 27
    edited 2009-06-02 01:43
    Jonny Mac
    Cool, do you have any suggestions on where to look for help with the code or examples of what I should do?· I'm a bit of an armature with coding.· In fact I will be learning the programming language for the SX as I go.· Programming the BS2 and Visual Basic are the only experience I have with programming and writing code.
    PeterM
    I suspected that I would be able to do it all with the SX but as I mentioned above I am an armature at programming.· Also I'm on a bit of a deadline.· I'm making a new medical device due by the end of July, if the BS2p40 would have worked I would be done by now.· I just afraid that I may will have to create a new control circuit which will take a solid week on top of learning the new programming language and writing the code.
    I was thinking that I might be able to run both microcontrollers simultaneously instead of master/slave.· The sine function and data collection are really just two separate systems on the same board.· Or that is what I was thinking.
  • RS_JimRS_Jim Posts: 1,771
    edited 2009-06-02 11:55
    SamW,
    There are lots of examples here on the forum for coding in SXB. You also can go to Parallax downloads and find examples in The Nuts and Volts columns. If you have Gunther Durbach's Book "Programming the SX Microcontroller" there are examples of Sine Table outputs (written in ASM). Data Collection functions are often performed using the PULSIN and RCTIME commands that are available in SXB. Download the latest Beta Version of SXB from the Sticky Thread at the top of the forum and play with it! Be Sure you download and read about the changes to SXB. There is also "Practical SXB" in the Downloads section from Parallax Downloads. You can download the Text as a PDF file and the Software is also available as a seperate download.
    RS_Jim
  • PJMontyPJMonty Posts: 983
    edited 2009-06-02 18:20
    SamW,

    Not to sound paranoid, but if you're an amateur programmer, why are you creating a medical device? Medical devices typically require incredibly stringent certification processes, including the software. Here's an example of how software can kill:

    http://en.wikipedia.org/wiki/Therac-25

    It was a radiation therapy machine that killed three people due to faulty software.

    Thanks,
    PeterM
  • SamWSamW Posts: 27
    edited 2009-06-02 19:02
    Peter
    ·
    This is a very reasonable question.· I tend to conjure up images of MRI and ultrasonic imaging equipment when I hear the term medical equipment or medical device.· This medical device is simply a complicated way to control a massager, (Conair touch-n-tone massager to be specific) and collect data on the patient and system to aid in medical research.·
    ·
    I did a Mechanical Engineering Senior Design Project, proof of concept, for West Texas A&M University and a client of the university.· They were so impressed with the improvements over the existing model that I was asked to produce an actual prototype that could be used for testing on a sample group.· The only changes I have made were incorporating a thermometer, accelerometer, flexiforce sensor, digital voltmeter and ergonomic design.
    ·
    I also demonstrated the theoretical ability to change the frequency of the massager using the microcontroller.· To do this I simply used the FREQOUT command with a peizo speaker.· We speculated that the signal could be manipulated enough to drive the massager.· With the BS2 I was actually able to do this, however due to limitations on programming the system would stop one action to perform another. (ie. The 50 Hz signal and oscillation would stop to take an accelerometer reading) This is where the second microcontroller comes in.
    ·
    The only dangers are the vibrating head vibrating +- 10% of the resonant frequency and electrical shock.· As far as resonant vibrations I am significantly below and we are operating with a factor of safety of about 150.· Electrical shock is taken care of my using a three prong grounded electrical cord.· All components are properly attached to the ground to prevent shock.· This was determined by electrical and physics departments.

    Attached is a picture of our initial prototype.· I'm sorry of the large size.

    Sam
    2102 x 1205 - 2M
  • LeonLeon Posts: 7,620
    edited 2009-06-02 19:21
    People are actually volunteering to be hooked up to that contraption? They must be mad! I hope you have plenty of liability insurance.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • SamWSamW Posts: 27
    edited 2009-06-02 20:38
    Not that one, but yes it will EVENTUALLY be used on people. The final step is to have it reviewed by a licensed Professional Engineer.
  • JonnyMacJonnyMac Posts: 9,213
    edited 2009-06-02 23:31
    I've attached a program for you to play with vis-a-vis generating sine waves with the SX. The program uses RA.0 and RA.1 as the control inputs to select the frequency from the list you specified. Output is through RB via an R-2R resistor network; of course, this will have to be buffered to drive anything but you should be able to verify the output on a 'scope. I used similar code in a simplistic mode project a couple months ago (though I only needed two frequencies).

    It's a very short program and may be a little advanced -- but as I've written the code (I love to experiment) you should spend your time studying it and learning from it ( Translation = I'm not going to explain it beyond the comments in the file. tongue.gif )

    Post Edited (JonnyMac) : 6/3/2009 12:04:01 AM GMT
  • SamWSamW Posts: 27
    edited 2009-06-02 23:41
    JonnyMac

    That is awesome! Thank you for the program.· I too love to experiment, I usually produce several versions of code for each of my projects.· I will send you the final version of my program so you can see what I have done and/or come up with.

    Thanks again,

    Sam
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2009-06-04 23:03
    If you want to drop in an SX48 processor in place of your BS2p40 module and want to learn a little surface mount soldering you could try one of these:

    http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&ssPageName=STRK:MESELX:IT&item=270399337963

    Assembled versions are available for $10 extra. They are pretty handy to have around when working on a breadboard.

    Robert
Sign In or Register to comment.