Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp 2.5 with BS2 Chip and Rev B Board of Education Error — Parallax Forums

Basic Stamp 2.5 with BS2 Chip and Rev B Board of Education Error

CodehammerCodehammer Posts: 6
edited 2005-09-26 05:54 in BASIC Stamp
Hi

I am Programming in Basic Stamp 2.5, using a·BS2 Chip and Rev B Board of Education. The·Problem I Am having is that the Basic Stamp 2.2 Program Checks the Device on COM1, when One clicks Run-> Identify.

In the Tips of the Day it is said to Have a max Power of 6V to the Board of Education.
The Manuals say the BS2 Chip Must have a Max of 7.5V, currently it's set to 6V.
I Currently have 1 Servo Connected so Can I Still use a max of 7.5V, or Lower than 6V
I Then Type in the Code below just to see if the Device Detects:
' {$PBASIC 2.5} 
' {$STAMP BS2} 
Sdat PIN 13 
Baud CON 396 
buff VAR Byte(3) 
FindPSC: 
DEBUG "Finding the PSC", CR 
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SCVER?", CR] 
SERIN Sdat, Baud, 500, FindPSC, [noparse][[/noparse]STR buff\3] 
DEBUG "PSC Version is ", buff(0), buff(1), buff(2), CR 
STOP

The Problem is that I used to have before I Changed the board of Education's Power from 4V to 6V was:
Finding the PSC
PSC Version is·xx and each time xx was a·Different Unicode Characters.

After making the Board of Education's Power to 6V the Following:
Finding the PSC
Finding the PSC
Finding the PSC
Finding the PSC
Finding the PSC
Finding the PSC
Finding the PSC
Finding the PSC
.....

Sdat PIN 13 means that Pin 13 Must Connect to the Servo form the Board of Education, I've Tried all other Pins (12-15) and modified the Code too. The Servo is on Channel 11 on the PSC.
Baud CON 396 ' Means that baud of 9600 is Set.(is that true or is it 38K4) Run-> identify has the Chip listed wiith 9600.

I·do Not Know what the 500 in the following·Line from the Manual·means :
SERIN Sdat, Baud, 500, FindPSC, [noparse][[/noparse]STR buff\3]

Could all these Problems be a Result of me using Rev B Board of Education when the manual I Have has a Rev·C Board of Education· Board?
Or is it because of Too little Power to the BS2 chip with 1 Servo (currently 6V instead of a max of 7.5)

I've read Somewhere That too Little Power will Cause the Chips to Reset.


Below is some of the Other Code's used to Rotate the Servo and Retrieve the Servo Position:

' {$STAMP BS2} 
' {$PBASIC 2.5} 
' {$PORT COM1} 
ch VAR Byte 
pw VAR Word 
ra VAR Byte 
Sdat CON 15 
baud CON 396 
ra=7 
ch=11 
DO 
pw=1250 
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR] 
PAUSE 1000 
pw=250 
SEROUT Sdat, BAUD+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.HIGHBYTE, CR] 
PAUSE 1000 
LOOP

' {$STAMP BS2} 
' {$PBASIC 2.5} 
' {$PORT COM1} 
ch VAR Byte 
pw VAR Word 
ra VAR Byte 
x VAR Byte 
Buff VAR Byte(3) 
Sdat CON 15 
baud CON 396 
Init: 
ra= 15: ch = 11 
DO 
pw=1240: GOSUB WRservo 
pw=240: GOSUB WRservo 
LOOP 
WRservo: 
ch=11 
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE,pw.HIGHBYTE, CR] 
FOR x = 0 TO 4 
PAUSE 1000 
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SCRSP", ch, CR] 
SERIN Sdat, Baud, 1000, Init,[noparse][[/noparse]STR Buff\3] 
DEBUG "Servo ", DEC buff(0), " ", HEX2 buff(1), " :", HEX2 buff(2), CR 
NEXT 
RETURN

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-13 11:49
    Based on the output of your program the BASIC Stamp appears to be resetting. Why? As it's [noparse][[/noparse]apparently] happening at the SEROUT line I would guess you've got a bad connection somewhere.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-09-13 12:54
    In your OP, you failed to mention you're trying to talk to a PSC board.

    Are you trying to talk to a PSC board? Or do you merely have one servo connected to the BOE?

    The code you are using is designed to talk to a PSC board, which will then control a servo connected to the PSC board.

    If it's one servo, then you should use "PULSOUT" to drive the servo directly from the BS2. And you should power the servo using Vdd, NOT 'Vin'. Then you can up the supply voltage to 7.5 volts.

    The 7805 Regulator the BOE uses to supply 5 volts to the BOE board (and the BS2, AND the 'Vdd' pin) can supply 1.5 amps -- but it does need a Vin of 7.5 volts to do that. A Vin of 6 volts WILL cause a brown-out.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-13 19:30
    One last thing to check...Is your Rev B BOE a USB or Serial Version?· If it's Serial then you cannot connect the PSC to the servo header as per the documentation.· It will over-voltage the PSC causing it to fail to communicate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • CodehammerCodehammer Posts: 6
    edited 2005-09-14 09:04
    allanlane5 said...
    In your OP, you failed to mention you're trying to talk to a PSC board.

    Are you trying to talk to a PSC board? Or do you merely have one servo connected to the BOE?

    The code you are using is designed to talk to a PSC board, which will then control a servo connected to the PSC board.

    If it's one servo, then you should use "PULSOUT" to drive the servo directly from the BS2. And you should power the servo using Vdd, NOT 'Vin'. Then you can up the supply voltage to 7.5 volts.

    The 7805 Regulator the BOE uses to supply 5 volts to the BOE board (and the BS2, AND the 'Vdd' pin) can supply 1.5 amps -- but it does need a Vin of 7.5 volts to do that. A Vin of 6 volts WILL cause a brown-out.
    What is OP? (Operation?)

    At the Moment the Serial Connection is to the REV B BOE, then From the BOE on X4 Pin 15 a Connection to the PSC, the Single PSC has on Pin 11 a Connection to the Servo.

    The·Test I'm Performing is from Doc's that Came from·This Site.
    Last Night Before Reading this I Connected the Jumper which is Suppose to be used when Having 2 Servo's, connected, anyways...· when I did the Ping Test above to the PSC, the Engine rotated slowly for 15 Seconds, then Stopped. Then Every Command Sent to the PSC like the Rotate Engine and Get Current Position caused the Green Light to Flash Then Stop almost showing it Received the Signal then Stopped. 2 Minutes Later there was No Activity and there was Nothing that Worked· - even after re-setting the Jumpers.

    I'm Begining to think the PSC is Damaged. If So How Do I Test It. I've Given the Setup (above) of the Connections & Hardware, if Possible Please Give me the PULSOUT and Vdd Code so as to Test if the PSC Works.

    Thanks For Your Responses
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-14 15:07
    Codehammer,

    ·· I'm unclear as to which BOE you have...Serial or USB.· If it's Serial, then you cannot use the servo connector you're using.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 9/14/2005 3:09:13 PM GMT
  • CodehammerCodehammer Posts: 6
    edited 2005-09-15 11:15
    Chris Savage (Parallax), 
    I Have Mentioned Above: 
    "At the Moment the Serial Connection is to the REV B BOE, then From the BOE on X4 Pin 15 a Connection to the PSC, the Single PSC has on Pin 11 a Connection to the Servo."
    


    What Connector Should I Use?



    allanlane5, 
    
    You Mentioned: 
    "If it's one servo, then you should use "PULSOUT" to drive the servo directly from the BS2. And you should power the servo using Vdd, NOT 'Vin'. Then you can up the supply voltage to 7.5 volts. 
    
    The 7805 Regulator the BOE uses to supply 5 volts to the BOE board (and the BS2, AND the 'Vdd' pin) can supply 1.5 amps -- but it does need a Vin of 7.5 volts to do that. A Vin of 6 volts WILL cause a brown-out."
    


    Are you Saying Above I Should Supply 5V to the BOE and 7.5 to the PSC? I'm Unsure what·Vinn is in the 1st Place. I Will Try and Scan the Doc that I Got (with Diagrams) which Explains all I Have Said Above.

    I Will Now Only be Back Monday on the Net: Before Later Today, will someone Please Post me Something so As to determine whether my PSC is Blown.
    Allanlane5, you Said that I Can Directly Connect the Servo to the BOE, if So Then I Can Verify if the PSC is Blown - The Code I have Used to do the Above was Directly from the Manual, I am Learning Slowly the Language of PBasic 2.5 - Please give me Code to Test it Directly from the BOE Rev B.

    Thanks.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-15 14:20
    Your statement was unclear because of the way you formed it.· The PSC has a serial connection to the BOE, and I couldn't tell if that's what you meant.· If you said, I have the Serial BOE, that would be clear.· As to whether or not your PSC is blown I cannot say, but I can tell you that you are connecting against what the documentation tells you.· It's listed in the documentation that if you're using the Rev B board not to use the servo header because it will provide Vin to the PSC, which requires 5V and no higher.· You have already clearly stated that you have moved to 6V which is too much voltage for the PSC.· Please re-read the documentation as it explains how to connect the PSC to the Vdd line for power using the breadboard.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • CodehammerCodehammer Posts: 6
    edited 2005-09-21 08:04
    Any Links you Got? PDF's?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-21 14:46
    The documentation, in PDF format, is located toward the bottom of the following web page.

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

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • CodehammerCodehammer Posts: 6
    edited 2005-09-22 07:14
    Chris Savage (Parallax) said...

    The documentation, in PDF format, is located toward the bottom of the following web page.

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

    Hey, thats Exactly the SAME one tht I'm triyng to Scan in cause I couldnt remember·where I DL it.

    The Diagram on page 3 is Exactly trhe Setup I've got, Except 1 servo on channel 11.

    Now as you can see there the BOE is Rev C -·I got Rev. B

    All·people Above mentioning VIN's and terms which is not on that PDF.

    Also the code I posted in the fisrt post can be found on pages 4, 5 and 6.

    Extract:

    Before You Begin 
    The processor used on the PSC requires a supply 5 VDC. Use a separate power supply for 
    your servos. In general, servos require 4-7.5 VDC. Be sure that the servo power source can 
    supply ample current at the proper voltage and will not damage the servos.
    

    So this·does not say whether 2 Servo's on the Board requires 7.5 V.

    6V is what I got on the PSC at the Moment < 7.5.

    What now, does this mean the PSC is damaged? I remember someone saying that the Servo can be controlled directly from the BOE - If someone posts this code so I can Test it· then I Know its NOT the BOE thats Damaged - Only the PSC.
  • doggiedocdoggiedoc Posts: 2,239
    edited 2005-09-22 11:07
    Codehammer said...

    Are you Saying Above I Should Supply 5V to the BOE and 7.5 to the PSC? I'm Unsure what Vinn is in the 1st Place. I Will Try and Scan the Doc that I Got (with Diagrams) which Explains all I Have Said Above.
    Are you using a separate power suppy for the PSC and the BOE? OR are you running 2 wires from the BOE Vdd and Vss to the PSC to power the servo? These 2 wires would attach to the blue terminal block on the PSC. I am not talking about the 5v TTL line from the BOE to the PSC - that is the 3 wires (red, black, white) that support processor on the PSC. Try using two separate battery packs both with fresh batteries.
    Codehammer said...

    I Will Now Only be Back Monday on the Net: Before Later Today, will someone Please Post me Something so As to determine whether my PSC is Blown.

    Allanlane5, you Said that I Can Directly Connect the Servo to the BOE, if So Then I Can Verify if the PSC is Blown - The Code I have Used to do the Above was Directly from the Manual, I am Learning Slowly the Language of PBasic 2.5 - Please give me Code to Test it Directly from the BOE Rev B.



    Thanks.
    If you are using 2 battery packs:
    How many mAh are your batteries that you have connected to the PSC? I have noticed that I get sporatic results when using lower ratings. The best results (and this is with my Hexcrawler) have been with a 3000mAh 7.2v R/C battery.

    Hope this helps,
    Doc
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-22 14:12
    The block of text I was referring to myself is on page 2, and states:
    PSC Docs said...
    This document assumes the host system is a BS2 module plugged into a Board of Education Rev C from Parallax, though those items are not required for proper operation. A three-conductor cable (included) connects the Ground, +5VDC, and serial I/O line to the host system. If you are not using the Rev C BOE, connect the wires of the three-conductor cable to VSS (black), +5VDC (red), and the I/O pin of your choice on your host system. Note the I/O pin number on the BOE that is connected as the serial I/O line on the PSC. This document assumes you have connected this cable into X4, slot 15. Ensure that the Vservo jumper selector, (between X4 and X5 on the BOE Rev C), is set to the VDD position.
    It states that if you are not using a Rev C BOE, where to connect your PSC.· It is not the servo headers.
    So, have you removed your connection from the servo headers?· Have you connected the pins as stated above?· If so, can you run the identify firmware code?
    BTW, 6V is fine, servos are designed to run at that voltage anyway.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • CodehammerCodehammer Posts: 6
    edited 2005-09-26 05:54
    I·Will get back to this on Thursday, the Project I have ends Wednesday.

    Thanks for your responses.
Sign In or Register to comment.