Hope everyone is well. I need some help getting my I/O to work when using SPI. Here is what I am trying to do.
I have 10 SPI controlled 8 channel switches, each of which has a chip select line which is active low. I also have three relays which need to be switched on at the start of the programme.
So my chip select lines are using I/O channels 1-10, SPI data is on I/O 0, Clock is on I/O 11 and relays are using I/O 12, 13 and 14.
I want to set all CS lines high at power on and set all relays on. I have a routine called set_io where I set all CS lines and relay lines high, I then thought when running the SPI routine, it would just use the relevant DIN, CLK, and CS mapped out in this routine. Well it stops the SPI working? Anyone know how to get over this issue?
Note: The SPI works fine when the set_io routine is not used.
Question
Adam1973
Hope everyone is well. I need some help getting my I/O to work when using SPI. Here is what I am trying to do.
I have 10 SPI controlled 8 channel switches, each of which has a chip select line which is active low. I also have three relays which need to be switched on at the start of the programme.
So my chip select lines are using I/O channels 1-10, SPI data is on I/O 0, Clock is on I/O 11 and relays are using I/O 12, 13 and 14.
I want to set all CS lines high at power on and set all relays on. I have a routine called set_io where I set all CS lines and relay lines high, I then thought when running the SPI routine, it would just use the relevant DIN, CLK, and CS mapped out in this routine. Well it stops the SPI working? Anyone know how to get over this issue?
Note: The SPI works fine when the set_io routine is not used.
Many thanks
Adam
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now