Author Topic: Cannot Test SW-16 Switches  (Read 1042 times)

Cheddar

  • Newbie
  • *
  • Posts: 7
    • View Profile
Cannot Test SW-16 Switches
« on: May 20, 2016, 10:26:06 PM »
Testing out a P3-ROC and an SW-16. I have both boards running from a 300W PC power supply.

dip switches:
P3-ROC all off
SW-16 #8 on

P3-ROC SW0 -> SW-16 Serial In

I notice D7 is lit (watchdog). I assume because I don't have a driver board attached (on order).

I am using an extremely simple config and launching from mpf.bat

Code: [Select]
#config_version=3

hardware:
    platform: p3_roc
    driverboards: pdb

switches:
    s_start:
        number: 0

keyboard:
    s:
        switch: s_start

I am simulating the switch with a jumper wire on J2. I can drive the switch using the keyboard key but not the jumper wire. I have even trie disabling the watchdog to see if the switches were disabled as well (wouldn't make sense but I tried it). The light went out but no difference in the switch.

Any thoughts?

Thanks

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2399
    • View Profile
    • PinballControllers.com
Re: Cannot Test SW-16 Switches
« Reply #1 on: May 20, 2016, 10:42:37 PM »
P3-ROC D7 (watchdog) means that software isn't communicating with the hardware.  So that's one problem to solve.  I'm not familiar with MPF, but you'll need to figure out how to start its run loop.

Once you have software running properly, here are some things to check if it still doesn't work:

1) Try turning P3-ROC dipswitch 7 and 8 on.  Most machines need both endpoints terminated on bi-directional buses (ie. for SW-16s).

2) Double-check you're closing the correct switch input.  Switch input 0 would be pin 1 on J2.  So you'd want to short J2-1 to ground (pin 10 on J2 or any other common ground point).

3) Double-check your serial cable between the P3-ROC.  Make sure the polarity is correct on both ends.

- Gerry

Cheddar

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Cannot Test SW-16 Switches
« Reply #2 on: May 20, 2016, 10:58:33 PM »
Set Dip Switches 7 & 8 ON on the P3-ROC
no Change

Verified D7 is going off (without the manual disable) when the app runs. Can verify with the following output

Code: [Select]
INFO : P3-ROC : Successfully connected to P3-ROC
INFO : Machine : Loading system modules...
INFO : DeviceManager : Loading devices...
INFO : BCPClientSocket.local_display : Connected to remote BCP host localhost:5050
INFO : Machine : Loading plugins...
INFO : SwitchController : Dumping current active switches
INFO : Mode.attract : Mode Starting. Priority: 10
INFO : Mode Controller : +=========== ACTIVE MODES ============+
INFO : Mode Controller : | attract : 10                        |
INFO : Mode Controller : +-------------------------------------+
INFO : SwitchController : <<<<< switch: s_start, State:1 >>>>>
INFO : SwitchController : <<<<< switch: s_start, State:0 >>>>>

Tested J2-1 to 10 and to ground
No change

Toned serial end to end and is fine. In practice:
P3-ROC J11-2 -> SW-16 J3-1
P3-ROC J11-3 -> SW-16 J3-2

I have 5 SW-16s and I've tried 2 of them. I'll try it with a simple pyproc app and see as well
 

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2399
    • View Profile
    • PinballControllers.com
Re: Cannot Test SW-16 Switches
« Reply #3 on: May 20, 2016, 11:15:44 PM »
Oh ok, then software is probably running fine.  I'm sure it's something simple.  Which LEDs are on on the SW-16?  You can also try turning dipswitch #8 on the SW-16 off.  If your serial wires are short enough, no termination might be better, though we don't yet know if this is a communication issue or something else.

- Gerry

Cheddar

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Cannot Test SW-16 Switches
« Reply #4 on: May 20, 2016, 11:21:13 PM »
D5, D6 and D8 are all lit.

No change with J8 off. Cable is about 12" long
« Last Edit: May 20, 2016, 11:25:47 PM by Cheddar »

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2399
    • View Profile
    • PinballControllers.com
Re: Cannot Test SW-16 Switches
« Reply #5 on: May 20, 2016, 11:25:42 PM »
OK - So the SW-16 board is powered up and running.  I don't know if MPF automatically logs switch events.  If an MPF user doesn't step in to help, then I'd need to have you try pinproctest or pyprocgame.  pinproctest will report all switch events, regardless of their being defined in a YAML.  Pyprocgame only reports switch events for switches defined in the YAML.

- Gerry

Cheddar

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Cannot Test SW-16 Switches
« Reply #6 on: May 21, 2016, 04:34:06 PM »
on a whim I turned a serial cable backwards and plugged it in. This cable was wired backwards!. Thanks for your help and thanks to Jab who worked with me offline to figure it out!

Cheddar

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Cannot Test SW-16 Switches
« Reply #7 on: May 21, 2016, 11:47:38 PM »
So here's the underlying issue. When I previously tested the cable I tested left pin to left pin etc... Looking at the boards the p3-roc goes left to right on SW0 and right to left on serial in. While the connectors indeed go + to + etc.. they do have to cross to make that connection. Looking at the pd-led I see the same layout.

Lesson learned, on to the lamps