Author Topic: PD-16 IDLEs between transfers using Arduino  (Read 142 times)

MasterMek

  • Newbie
  • *
  • Posts: 14
  • DesignDude
    • View Profile
PD-16 IDLEs between transfers using Arduino
« on: June 20, 2017, 09:54:45 AM »
Wow. I've been gone so long.
There is not much going on at the forum I see...
I'm starting up my project again.
I've a question though.
The documentation and the Arduino test sketch both mention 5 extra idles between transfers. The sketch also mentions a for-loop. The example doesn't show any loop or idles. Am I wrong?

Mek

MasterMek

  • Newbie
  • *
  • Posts: 14
  • DesignDude
    • View Profile
Re: PD-16 IDLEs between transfers using Arduino
« Reply #1 on: June 20, 2017, 09:58:59 AM »
Also, using the PD-16 with Arduino and pwm requires constant transfer of data right? I suppose I need a constant transfer for the watchdog to be operational too?
Btw. I mention Arduino but will use a teensy instead which is a bit faster.

Mek

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2399
    • View Profile
    • PinballControllers.com
Re: PD-16 IDLEs between transfers using Arduino
« Reply #2 on: June 26, 2017, 08:01:00 PM »
The documentation and the Arduino test sketch both mention 5 extra idles between transfers. The sketch also mentions a for-loop. The example doesn't show any loop or idles. Am I wrong?

The comments in the arduino sketch are saying that if you used a for-loop instead of the 5 explicit SPI.transfer calls, it would add an additional 5 IDLEs between cycle (to process the for-loop).  Just implementing the code as is gets you enough time between transfers without too much.  If you're using a faster device (ie. teensy), you may see different results.  Adjust accordingly.

Also, using the PD-16 with Arduino and pwm requires constant transfer of data right? I suppose I need a constant transfer for the watchdog to be operational too?

Constant transfers are necessary to properly tickle the watchdog yes, assuming you want to use the watchdog.  Dipswitch 6 disables watchdog functionality.  For PWM you need not write constantly.  Just write as often as you need to to change an output's state.

- Gerry