View Full Version : Brand new to Micros a few q's

T Chap
05-20-2006, 12:59 PM
I have a product I am developing that is currently logic based that sends commands to a servo motor controller that recieves a 4 bit address for 16 positions, program finished, start, stop(interrupt). It needs 14 inputs(0/5volts) that are simple high/low logic pulses.

As far as experience, I can build a board no problem, the chip selection and programming I have to learn fromn scratch.

The motor controller needs 6 inputs, and there are 3 LEDs to drive so I need 9 outputs at least.

I want to program in the simplest manner possible simple if then commands,

ie if input 1 is high, output a 100 ms pulse on pins a,b,c,d (hex 0000) and after 50 milliseconds output start command for 100 ms on pin x

ie if input 1 is high, and input 2 then goes high, ignore input 2

I don't know how to write the commands but I'll cross that bridge later. I just put the MAC version on my comp, but not sure how to interface to the chip when I get it. Is there a USB interface available?

Here is the main issue: What is the best and cheapest product to do this simple task of managing the inputs and outputting the results?

Is there a difference between the end result of programming on PC versus the MAC version? I dont have serial ports on the MAC but can add a card I suppose. Is there a reason to choose one over the other for programming as I have both, but prefer the MAC.

Thanks for any advice on getting up and running. I'd like to order a chip right away and get going.

05-20-2006, 10:30 PM

Have you looked into the SX series of chips? Siince this is to be a production thing, the price of the SX is very attractive. It's not *quite* as easy to program as the Stamp, but it sounds like your program will be very simple anyway. You do have to buy a programmer for the SX, but the IDE is free and like all Parallax products, easy to use.


If you do want a Stamp, sounds like the BS1 would do it for you, with a shift register input to expand I/O.


www.madlabs.info (http://www.madlabs.info) - Home of the Hydrogen Fuel Cell Robot

Mike Green
05-20-2006, 10:48 PM
You can easily do software development for the BS2 series using a Mac, look at the free 3rd party IDE called MacBS2. If you get the USB Board of Education from Parallex for a development board, it has the USB to Stamp interface built-in. You just have to install the FTDI Mac USB driver from the FTDI website. It's harder to do development for the BS1 or SX with a Mac. You actually have to run Windows using Guest PC or Virtual PC. If you have one of the newer Intel Macs, there are other programs that will allow you to run Windows programs on the Mac

T Chap
05-21-2006, 12:45 AM
Thanks for the tips. For the price the SX makes sense, expecially sinvce I need around 20 i/o's and it does not appear that the Stamps offer moe than 16, plus they are very pricey for production. The SX seems it will do far more than my simple app, but as it grows maybe that would mean I'd not need to always be upgrading chips.

I downloaded the Macbs2 already and as far as the BS2 it seems straightforward, get a USB to serial and you are running. As far as the SX chip, what wuld be different than using the BS2SX for $49 over the SX chip alone for 3 bucks? Since the macBS2 supports the BS2SX, is it as simple as getting a USB to Serial plus a board to plug in the stamp, and that is all there is to it? How much more is involved to program the SX without the stamp? The Pbasic seems very easy to learn for my simple needs, does the SX need a diffrent software for programming that is more complicated?

T Chap
05-21-2006, 01:08 AM
Hey I just noticed that I can get the OEM set for much cheaper than the Stamp, and it can be programmed with the Windows editer. Since I am using this for production in a board I am already building, this OEM embedding makes much more sense cost wise. I just need the fastest and easiest way to get up to speed. If using the BS2SX oem modeule, I'd be able to programn on the MAC or PC right? I am assuming that programming a stamp in the Windows or PC editor is much easier than compiling for the SX directly?

Thanks for the help

05-21-2006, 01:15 AM
You'll need a SX Blitz www.parallax.com/detail.asp?product_id=45170 (http://www.parallax.com/detail.asp?product_id=45170) or an SX Key www.parallax.com/detail.asp?product_id=552-00007 (http://www.parallax.com/detail.asp?product_id=552-00007) along with an SX development board www.parallax.com/detail.asp?product_id=45205 (http://www.parallax.com/detail.asp?product_id=45205) or a Professionial Development board to program an SX processor.
Another option is to purchase a bundled kit that contains the SX Key plus a development board www.parallax.com/sx/programming_kits.asp (http://www.parallax.com/sx/programming_kits.asp)

The SX can be programmed in assembly language or a version of BASIC called SX/B - which is similar to Parallax Basic.

You'll also need to be running Windows on a PC (or a PC emulator) to program the SX chip.

The big difference between a BS2SX and an SX processor is the BS2SX contains a SX preprogrammed with the Parallax BASIC interpreter, a voltage regulator circuit, EEPROM, crystal and RS232 to TTL serial circuitry all built into a DIP24 module. If you want to use the SX, you'll need to buy a development board (like the SX Tech board) or design your own board that contains these elements.

05-21-2006, 01:19 AM
You can program the BS2SX or the BS2SX OEM module with a Mac or PC - it costs $59 www.parallax.com/detail.asp?product_id=27294 (http://www.parallax.com/detail.asp?product_id=27294)

T Chap
05-21-2006, 02:14 AM
It looks like the options are limited to the Basic 2P 40 to get the I/O's I need. I need at least 20 i/o's and room to expand afterwards. Since there is an oem interpretter board available, does it make sense just to get a 2p 40 stamp plus the Pro Dev Board and and get up to speed. learn the programming and getting my system coded, then at some point switch to the OEM setup which should be identical as far as operation and cheaper?

The macbs2 shows the BS2p40 as an option for programming, so with the pro dev board I can be running right away?

Thanks again

Mike Green
05-21-2006, 02:30 AM
If you can order both the BS2p40 module and the BS2p40 Demo Board this weekend from the Parallex website, you can get a huge discount. You'll also need a USB to serial adapter ($34 for FTDI from Parallax #800-00030) if you don't have one already and a power supply (7.5 to 12V at 500-1000mA). I have one of the BS2p40 Demo Boards and a Keyspan #USA-19QW USB to serial adapter and a "wall wart" from Radio Shack for 9V at 1A. I takes more time to unpack the box than to install the serial driver and MacBS2, plug it all together and start working with the BS2p40.

T Chap
05-21-2006, 03:16 AM
Very good, I am odering that stuff now. Does the Parallax USB to serial run on mac or do I need the Keyspan to get Mac drivers?

Mike Green
05-21-2006, 03:25 AM
The drivers are different between the Keyspan unit and the FTDI units that Parallax uses. Download the Mac FTDI drivers from their website <http://www.ftdichip.com/FTDrivers.htm>. I haven't used the Parallax FTDI USB to serial adapter, but the chip is the same as that built into the Propellor Demo Board and that works fine with the FTDI driver.

Mike Green
05-21-2006, 03:30 AM
The Parallax USB2SER adapter also uses the FTDI chip and works just fine on my PowerBook with the FTDI driver. It turns out I bought the Keyspan adapter several years ago for Stamp development before other USB to serial adapters were in widespread use.

T Chap
05-21-2006, 03:41 AM
I can pick up the keyspan USA 19hs that works on mac os x nearby, does it make a difference really? If not I'll just go get this one at Compusa.

As for the chip in testing purposes, do you float all i/o's not in use, or just set them all to outputs instead of letting the inputs float around?

Waiting on new gadgets to arrive is the worst.

05-21-2006, 04:08 AM
The Parallax Professional Development Board has a FTDI USB to Serial adapter built-in - so there's no need to buy another one. You many need to install an older version of the FTDI drivers for Mac use according to www.muratnkonar.com/otherstuff/macbs2/faq.shtml#FTDI (http://www.muratnkonar.com/otherstuff/macbs2/faq.shtml#FTDI)

Mike Green
05-21-2006, 04:14 AM
1) Either the Keyspan or the Parallax adapter should work fine .. whatever's convenient.
2) For testing purposes, I just leave the inputs floating. It may increase the current draw of the chip, but that's really an issue only if you're running it off batteries. For production purposes, I'd tie each unused port (data) pin to 5V using a 10K resistor. For that matter, for production purposes, I'd put a 220 ohm resistor in series with any input going "off board" (for protection purposes) and a 10K resistor to ground or 5V (depending on what's considered "off") in case you disconnect the signal.
3) The Stamp manual is excellent, very thorough, and full of examples. Parallax's website has lots of examples as well, particularly in the Nuts and Volts articles that are on-line. Most anything you will want to know has already been written about and is somewhere on the website.

T Chap
05-21-2006, 04:17 AM
Ok I just ordered the Parallax usb to serial, BS2p40, demo board, cable, I should be able to turn on some LED's with this setup right? Now to get going on learning the programming. Thanks for the halp everyone.

Kevin Wood
05-21-2006, 12:43 PM
The best place to start is the "What's a Microcontroller" text. You can download a copy of it from the Parallax website. Note, however, that it is based on the standard BS2, so there will be minor variations in the code examples.