Author Topic: PRDriverPatter() and resetting P-ROC  (Read 1175 times)

relwin

  • Newbie
  • *
  • Posts: 14
    • View Profile
PRDriverPatter() and resetting P-ROC
« on: June 26, 2015, 03:00:46 PM »
Hi folks -- first time questions for me!

We're using P-ROC (latest FW) with an original WPC I/O board, latest libpinproc with "WPC dim lamp" fix.
The P-ROC performs nicely and allows us to focus on other dev items.

I have a few minor questions...

Question 1:
 in driving the LED (lamp) matrix I get I nice steady "on" when using
PRDriverSchedule(proc, driver_output, 0xFFFFFFFF, 0, 1);

but I can't find a "magic" combination of parameters to get PRDriverPatter() to also produce a flicker free "on".
My assumption of PWM when off=0 and on>0 means no off pulse.
The best combination I found is on=255,off=1 but this shows a periodic flicker. Using on=255,off=0 gives a slow periodic strobe.

So, am I using PRDriverPatter() wrong or is this how it works and I need to use PRDriverSchedule() when I want full "on"?

Question 2:
Is there a way to reset the P-ROC's USB link thru software?

The scenario is I'm moving the USB cable to a different computer then restarting my pinball code. The P-ROC usually doesn't like that (reports errors continuously) and won't reconnect unless I power-cycle the P-ROC. I'm initializing the P-ROC based on the libpinproc example code.
Or perhaps there's a reliable way to shut down the USB before I swap?


Thanks!
--Randy

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2397
    • View Profile
    • PinballControllers.com
Re: PRDriverPatter() and resetting P-ROC
« Reply #1 on: June 26, 2015, 05:17:05 PM »
Hi folks -- first time questions for me!

Welcome!

Quote
Question 1:
 in driving the LED (lamp) matrix I get I nice steady "on" when using
PRDriverSchedule(proc, driver_output, 0xFFFFFFFF, 0, 1);

but I can't find a "magic" combination of parameters to get PRDriverPatter() to also produce a flicker free "on".
My assumption of PWM when off=0 and on>0 means no off pulse.

Patter with an on or off of 0 is undefined.  I honestly don't know what the hardware would do with that.  You can use Pulse(0) or the full schedule.

Quote
Question 2:
Is there a way to reset the P-ROC's USB link thru software?

Unfortunately not.

Quote
The scenario is I'm moving the USB cable to a different computer then restarting my pinball code. The P-ROC usually doesn't like that (reports errors continuously) and won't reconnect unless I power-cycle the P-ROC. I'm initializing the P-ROC based on the libpinproc example code.
Or perhaps there's a reliable way to shut down the USB before I swap?

You would have to disable event reporting from the P-ROC.  Otherwise the P-ROC will queue up things to send to the host and overflow.  Events include switch events and dmd events, both of which can be disabled with libpinproc calls.  I don't believe anybody's written any convenience functions in pypinproc or pyprocgame to help with that yet.

- Gerry

relwin

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: PRDriverPatter() and resetting P-ROC
« Reply #2 on: June 26, 2015, 06:06:04 PM »
Alright -- thanks for the info!
(now back to playing Archer!)
--r.e.

MOcean

  • P3 Developers
  • *
  • Posts: 820
  • Michael Ocean
    • View Profile
Re: PRDriverPatter() and resetting P-ROC
« Reply #3 on: June 26, 2015, 06:48:56 PM »
Awesome to finally know what board set you're using.  Archer looks great thus far :)

- Michael


Alright -- thanks for the info!
(now back to playing Archer!)
--r.e.

lachied

  • P3 Developers
  • *
  • Posts: 296
    • View Profile
    • Pin build/blog
Re: PRDriverPatter() and resetting P-ROC
« Reply #4 on: June 26, 2015, 07:53:23 PM »
Just thought Id chime in to say I saw the Archer thread on Pinside and it is looking pretty sweet. Keep up the good work!

relwin

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: PRDriverPatter() and resetting P-ROC
« Reply #5 on: June 26, 2015, 11:53:52 PM »
I'll post a short SW writeup in the SW section.