Skip to content

Commit dae5f01

Browse files
committed
Increase SPI speed to 4Mhz with DRV8908
1 parent 88816bf commit dae5f01

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ftduino/libraries/Ftduino/Ftduino.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ void Ftduino::output_init() {
447447
#endif
448448
#if defined(OUTPUT_DRIVER_AUTO) || defined(OUTPUT_DRIVER_DRV8908)
449449
{
450+
// increase SPI speed to 4 Mhz as PWM is implemented by hardware,
451+
// no SPI IRQ is needed and thus the SPI speed does not affect performance
452+
SPCR &= ~((1<<SPR1) | (1<<SPR0));
453+
450454
// give chip a millisecond to come out of reset/sleep
451455
delay(1);
452456

0 commit comments

Comments
 (0)