Shop OBEX P1 Docs P2 Docs Learn Events
Newbie on SX chip — Parallax Forums

Newbie on SX chip

nlopesnlopes Posts: 4
edited 2007-08-09 03:51 in General Discussion
Hi everyone. I wrote an email to pre-sales support and they suggested I ask some of these questions here on the SX forum. So, here goes:

I'm new to programming microprocessors and have been seriously looking into purchasing a development kit to get started on some projects. To be honest, I was looking at going straight to PICs using a 3rd party compiler (such as Proton). However, after visiting the Parallax forums and doing a little reading, I'm interested in the SX chip. It's low cost like a PIC and seems to have all the power I may need. The thing that scares me is that I have little knowledge of assembly, although I'm very familiar with BASIC for the PC, so I feel comfortable with the statements I would use (such those for the Stamp). Since there is an SX/B compiler which allows me to program the SX in BASIC, it makes it seem like a good way to start. My questions are related to a project I want to create:

1). I'd like to create my own "sprinkler timer" which would be a small board that will contain an LCD, keypad, and maybe a rotary switch. I think the LCD and keypad would use serial communication to the processor. Can I connect all of these items to an SX chip (SX28AC/DP-G) as I probably would a BS2? Basically, I'm looking for ease of use in connecting and working with these.

1a). I'd like to try to make some of my own hardware rather than buying pre-made boards if possible. For example I looked at the keypad you have which works with the MemKey. Could I just interface a keypad to input data into a processor like the SX or do I need the MemKey (which is pre-built)? My guess is that just connecting the keypad would require an input for each key while using something like the MemKey would "convert" the input to serial data for the processor. Is this correct? I apologize for the dumb question, but my experience in doing some of this is low and this will be my first project. I just wanted to include as much of the hardware design on the main board rather than piggying a bunch of boards together (I thought it would be a great way to learn more too).

1b). My project will need to keep track of date/time and at a certain day/time, trigger an output (12V relay) for a specified amount of time. The settings, like amount of time the output is to remain on, when it is to be triggered, etc…. must be pre-entered by the user (via keypad/LCD) and stored in memory. I'm interested in the DS103 time keeping chip you have on your site. Can I interface this with the SX too?

1c). I'd also like to add RF ability to my circuit (to turn zones on/off from a distance) and am interested in the RF Transmitter/Receiver you have. I noticed in the documentation that it shows STAMP examples, but nothing for SX. Will these work with the SX? Not sure of the level of difficulty.

2). With regards to question 1b, would the SX be able to store information related to a sprinkler timer (i.e. enough RAM)? I know this depends on the size of my code too. I'm not sure if it's possible or how to interface an external EEPROM to the SX chip?

2a). Can I used external memory like a SD flash memory card? If this would be possible, I'd love to learn about how to use SD (MMC) flash memory with processors. Not sure if libraries or something is available for this.

3). Are there any further development plans for the SX basic compiler (i.e. adding features/commands, etc&#8230[noparse];)[/noparse]? I noticed it doesn't support SELECT CASE statements. Is it very limited compared to the BASIC Stamp instruction set or PICBasic?

4). If I'm understanding the requirements of the SX chip correctly, I'll need the SX-Key to program it and also debug it in-circuit, correct?

Again, I apologize for the dumb questions, but I saw a lot of assembly on the SX and that makes me hesitate a little. Wasn't sure if this would be a great way to start. I wouldn't mind starting with a Basic Stamp (BS2 OEM) too, but I just wanted to try and keep my costs as low as possible. Any information and suggestions you may provide would be greatly appreciated.


Thank you very much for your time,

Nelson

Comments

  • John CoutureJohn Couture Posts: 370
    edited 2007-08-08 21:23
    May I suggest something that might work also? Use the SX to communicate via serial commands with the PINK module (Ethernet Interface). Now you put all of the storage, command and control in your desktop PC.

    The PINK module is basically a small web server that can be used to communicate with your irrigation controller via your home ethernet. The sx will then take the commands from the PINK and control relays or electronic switches that will turn the irrigation valves on and off.

    All of the rest of the software is done in Visual Basic or Javascript and run from your desktop pc. (VB 2005 Express is free, Javascript is free).

    Thus, your only cost will be the PINK and the SX along with relays or such.

    As for the wireless capability, you might want to put that a little further back on the development cycle. Wireless means batteries which means you have to recharge the batteries which means a solar system which means a voltage regulation system, etc. You can run a LOT of wire in conduit for the cost of a wireless system (I am on 5 acreas so, believe me, I've considered it!) I just run the wire at the same time I dig the trenches for the water.

    If you want I will work with you (I need to do the same thing someday) and we can cry on each other's shoulder when things don't go well (grin). Besides, I need a mentor to egg me on so that I can design this as a project for my Embedded Computer Programming Class. My class starts in Feb 2008 so we have a little time to work on it via this forum.

    Ref: PINK Module:

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

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • BeanBean Posts: 8,129
    edited 2007-08-08 21:47
    1) Serial communication are no problem. SERIN and SEROUT

    1a) I guess it depends on how many keys you require. You could use up alot of I/O pins if you need alot.

    1b) SX/B supports SPI and I2C, so it should be no problem.

    1c) PBASIC isn't too hard to convert.

    2) An I2C eeprom would probably be the easiest to use.

    2a) There are several devices. Parallax sells the Memory stick datalogger.

    3) There is a beta in the works, but it probably won't be released soon. SX/B is designed to help users get started in assembly. It generates easily readable assembly language.

    4) The SX-Key will allow you to debug. The SX-Blitz is a programmer only. (Get the SX-Key)

    If you have little experience in microcontrollers, the basic stamps will be easier to get started.

    Bean.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2007-08-08 23:07
    There is a soon to be released book on SX/B in the works, which you might want to look at:

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


    That being said, I think that you would be much better off starting with the Basic Stamp. It is much easier to use for beginners, and there is far more educational material available for it from Parallax and other sources.

    As for keeping costs down, you can use OEM parts to build the Basic Stamp into your finished design.
  • CCraigCCraig Posts: 163
    edited 2007-08-08 23:16
    Nelson,

    First, welcome. You will find no better support from any company or user forum.

    The SX is great controller and can do any of the things you want. Your project is a very ambitious one for the first time user. Not to worry, the basic that the SX uses will be a easy step seeing that you know (any flavor of) basic on a PC. You will have to learn some things about the SX chip itself and some other support chips (radio, EEPROM, keypads etc.). I don't know your level of electronics knowledge but you should have no problems.

    Here's what I would do. Break down the project into simple steps. For now, forget the radio. Keep it in your plans and in your mind, but put it on a back burner. Strip it down. Maybe just the RTC, EEPROM/Memory card and valve controls. Maybe even less than that.

    Take small steps.

    HTH, Chris

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm not scared of your robot. I'm covered by Old Glory (youtube)
  • nlopesnlopes Posts: 4
    edited 2007-08-09 00:58
    Thank you for all the responses! John, I actually thought about the idea of adding Ethernet control to the project. However, as others have mentioned about taking it in steps, I was thinking of adding that type of control as another phase. I would love to control it via the internet (heck that means even a PDA or cell phone could do it and there's the "remote control".) I just want it to be able to run on it's own without a PC telling it what to do all the time. Along with being able to program the controller on-board, it would be great to be able to update the program via a web interface too. I certainly wouldn't mind adding it with the design if time and cost permit. All the great feedback offers good advice and I will take this on in small steps. In doing so, I will leave the RF (radio) out of it on the first go and make that as an add-on later. My idea was simply that if I was standing out in the yard testing/adjusting the sprinklers, I could click on that zone (valve) from right there without having to run into the garage and start it manually.

    My biggest dilemma is that I still have to decide between doing this with either the Basic Stamp II (OEM) or going to the SX.

    My electronics experience is average, but I think I know enough to get me through parts of it. I'm glad that Parallax has such great support along with everyone here on the forums.

    Best Regards,

    Nelson
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2007-08-09 03:51
    If you want a good idea of the BS2 vs. SX, download some of the Stamps in Class manuals, and skim through them. Then take a look at the SX docs. Also take a look at some of the downloadable Nuts & Volts articles from the Parallax site.

    After doing that, you should have a good idea on how well you will relate to the two different platforms.
Sign In or Register to comment.