so I am having a weird issue, I am using the C/C++ SDK with visual studio to program a raspberry pi pico. The project is using a rotary encoder with push button and lcd to control a seperate PCB. Almost everything is working but when I try and send an SPI command on SPI1 the program just completely stops working, as in using the encoder or button causes no change in either serial monitor or in the lcd.
I know it is an issue with the spi1 because if I change it to spi0 I get no crash and I also tried changing the value I was sending on spi1 and that made no difference and it still crashed.
Below is a part of the code that shows how I used spi0 which works and spi1 which doesnt work, I can include the full project if needed but it is kinda long so, let me know if it is needed.
if(Mode_Counter == 1) { // data to send on SPI for Mode 1
Ctrl_bit_and_data = data.Ctrl_bit_and_Data_Func_Write();
spi_write16_blocking(SPI_PORT, &Ctrl_bit_and_data, 1); // this is spi0 and works fine
}
if(Mode_Counter == 3) {
Counter_LV = Counter;
Count_LV.set_position_LV(Counter_LV);
Ctrl_bit_and_data_LV = data_LV.Ctrl_bit_and_Data_Func_Write_LV();
spi_write16_blocking(spi1, &Ctrl_bit_and_data_LV, 1); // this is the line that isnt working
}
Any help or guidance with this would be greatly appreciated I am very stuck as to the issue with this.