I'm trying to read an array of HX710's. As soon as I upload to PICO it crashes. What could be causing this?
++ MbedOS Fault Handler ++
FaultType: HardFault
Context:
R0 : 20041F00
R1 : FFFFFFFC
R2 : 20041EFC
R3 : 6B36D3FC
R4 : 00000001
R5 : 200005F8
R6 : 20000B8C
R7 : 20041F00
R8 : 00000000
R9 : 4B32B500
R10 : 00000000
R11 : 00000000
R12 : 6B36D3FC
SP : 2000A6F8
LR : 1000690B
PC : 1000CAC8
xPSR : 41000000
PSP : 2000A6D8
MSP : 2003FFC0
CPUID: 410CC601
Mode : Thread
Priv : Privileged
Stack: PSP
-- MbedOS Fault Handler --
++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x1000CAC8
Error Value: 0x2000A7A4
Current Thread: main Id: 0x20002650 Entry: 0x10006931 StackSize: 0x8000 StackMe
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&osver=61700&corO
-- MbedOS Error Info --
Im using the code below from the HX710 library examples.
#include "HX710Array.h"
////////////////////////////////////////////////////////////////
// PARAMETERS
////////////////////////////////////////////////////////////////
const int PD_SCK = p12;
const int DOUT0 = p16;
const int DOUT1 = p17;
const int DOUT2 = p18;
const int DOUT3 = p19;
#define SERIAL_PLOTTER
////////////////////////////////////////////////////////////////
// SETUP
////////////////////////////////////////////////////////////////
HX710Array ps;
void setup() {
SerialUSB.begin( 115200 );
int douts[] = { DOUT0 , DOUT1 , DOUT2, DOUT3 };
ps.initialize( PD_SCK , 3 , douts );
}
////////////////////////////////////////////////////////////////
// LOOP
////////////////////////////////////////////////////////////////
void loop() {
int32_t value0, value1, value2, value3 ;
while( !ps.isReady() );
ps.readAndSelectNextData( HX710_DIFFERENTIAL_INPUT_40HZ );
value0 = ps.getLastDifferentialInput( 0 );
value1 = ps.getLastDifferentialInput( 1 );
value2 = ps.getLastDifferentialInput( 2 );
value3 + ps.getLastDifferentialInput( 3 );
#ifdef SERIAL_PLOTTER
SerialUSB.print( value0 );
SerialUSB.print( "\t" );
SerialUSB.print( value1 );
SerialUSB.print( "\t" );
SerialUSB.println( value2 );
SerialUSB.print( "\t" );
SerialUSB.println( value3 );
#else
SerialUSB.print( "differential input of ADC0 (40 Hz): " );
SerialUSB.println( value0 );
SerialUSB.print( "differential input of ADC1 (40 Hz): " );
SerialUSB.println( value1 );
SerialUSB.print( "differential input of ADC2 (40 Hz): " );
SerialUSB.println( value2 );
SerialUSB.print( "differential input of ADC3 (40 Hz): " );
SerialUSB.println( value3 );
SerialUSB.println();
#endif
}