Shop OBEX P1 Docs P2 Docs Learn Events
BS2px and PIN 7 — Parallax Forums

BS2px and PIN 7

Mike GMike G Posts: 2,702
edited 2006-11-06 02:55 in BASIC Stamp
Is there anything special about PIN 7 on the BS2px?·

If I change the PIN declaration below to "PSC PIN 7"·the code fails however every other PIN (0-6, 8-15)·works perfectly.· I tested the code on a BS2 and every PIN works as expected.


' {$STAMP BS2} 
' {$PBASIC 2.5} 
' Set baud for all STAMP versions 
#SELECT $STAMP 
#CASE BS2SX, BS2P 
 N2400 CON 1021 + $8000 
 N38K4 CON 45 + $8000 
#CASE BS2PX 
 N2400 CON 1646 + $8000 
 N38K4 CON 84 + $8000 
#CASE #ELSE 
 N2400 CON 396 + $8000 
 N38K4 CON 6 + $8000 

#ENDSELECT 

PSC PIN 15 ' PSC I/O Pin 
buff VAR Byte(3) ' Temporary variable
 
Main: 
 DEBUG CR,"----------------------------",CR 
 GOSUB Get_PSC_Settings ' Check PSC Baud and Version 
 DEBUG CR,"----------------------------",CR 
STOP 
'------------------------------------------------------------------------- 
Get_PSC_Settings: 
 DEBUG "Getting PSC Information", CR 
 SEROUT PSC, N2400, [noparse][[/noparse]"!SCVER?",CR] 
 SERIN PSC, N2400, 500, Try_38K4,[noparse][[/noparse]STR buff\3] 
 DEBUG "Baud = 2400", CR, "PSC ver: ", buff(0), buff(1), DEC buff(2) 
 GOTO N2400_Found 
Try_38K4: 
 SEROUT PSC, N38K4, [noparse][[/noparse]"!SCVER?",CR] 
 SERIN PSC, N38K4, 500, Baud_Exception,[noparse][[/noparse]STR buff\3] 
 DEBUG "Baud = 38K4", CR, "PSC ver: ", buff(0), buff(1), DEC buff(2), CR 
 N2400_Found: 
RETURN 
'------------------------------------------------------------------------- 
Baud_Exception: 
 DEBUG "Failed", CR 
RETURN


Thanks,
Mike


Post Edited (Mike Gebhard) : 11/5/2006 5:35:25 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-06 00:22
    Mike,
    ·
    ·· There is nothing special about P7 on the BS2px.· Is it possible you have damaged the pin somehow?· What board are you using?· Is it possible something on the board is also connected to that pin on the module?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Mike GMike G Posts: 2,702
    edited 2006-11-06 02:55
    Chris you are a hard working...

    I'm using a BOE and no external circuits. You're right I guess PIN 7 must be damaged. I wired up a simple LED circuit and all pins but PIN 7 function. I'm not sure when the damage occurred. I rarely use the BS2px.
Sign In or Register to comment.