Question about custom BOB for a 7i92
26 Apr 2023 09:18 - 26 Apr 2023 09:21 #269959
by blazini36
Replied by blazini36 on topic Question about custom BOB for a 7i92
This is the pinout I need the firmware for.
Hopefully I didn't make any mistakes. I ran out of IO so I had to use a decoder chip, SN74LVC1G139 for SPI CS lines.
Hopefully I didn't make any mistakes. I ran out of IO so I had to use a decoder chip, SN74LVC1G139 for SPI CS lines.
Attachments:
Last edit: 26 Apr 2023 09:21 by blazini36. Reason: fix file
Please Log in or Create an account to join the conversation.
27 Apr 2023 05:01 - 27 Apr 2023 13:47 #270029
by PCW
Replied by PCW on topic Question about custom BOB for a 7i92
I'll try and get to this in the next few days.
Note your pinout is missing the CS frame pin
(this enables the external /CS decoder, otherwise there is no way to de-assert /CS)
You could gain 4 pins by using an inmux module for the 8 GPIO inputs
This needs a 74HC251 external mux and now 4 interface pins (A0,A1,A2 and D)
It also add hardware debouncing and 4 MPG encoders
Note your pinout is missing the CS frame pin
(this enables the external /CS decoder, otherwise there is no way to de-assert /CS)
You could gain 4 pins by using an inmux module for the 8 GPIO inputs
This needs a 74HC251 external mux and now 4 interface pins (A0,A1,A2 and D)
It also add hardware debouncing and 4 MPG encoders
Last edit: 27 Apr 2023 13:47 by PCW.
Please Log in or Create an account to join the conversation.
27 Apr 2023 18:20 - 27 Apr 2023 18:40 #270073
by blazini36
This decoder I used doesn't have an ena/inh pin so a CS Frame pin wouldn't have anywhere to go. Not being an SPI guru I didn't realize this was necessary, I figured each chip is de-asserted when another is selected via address lines but I gather that you mean it needs a global de-assertion.
I already sent the gerbers out for a prototype spin, I always assume I'll make at least one mistake 1st pass so it's not a huge deal
The docs are a little sparse on hostmot2 BSPI so I'm not sure what it can and can't do (man pages are missing). I've got the decoder selecting 4 10bit ADC's, If I omit 1 ADC that I don't really need, the other 3 decoded CS lines will be de-asserted when it's address is selected (1,1 on the input will select the missing 4th output.
Otherwise I can just remove the decoder for the time being and bodge through the 2 CS lines directly to the chips. I assume no frame pin is required when using straight CS lines. I only actually need the 2 for the machine this is going in. I might be able to get my friend to write the component for it so I'd just like to have something working. Do you know of any docs that explain the BSPI functions or is the 7i65 driver the only thing to go by?
I'll revisit the inmux thing if I have to revise it. I had just enough IO pins in the current layout. If I have to scrounge more IO pins using inmux I will probably drop the decoder since I'd only gain 1 CS line if I have to use a frame pin anyway.
Replied by blazini36 on topic Question about custom BOB for a 7i92
I'll try and get to this in the next few days.
Note your pinout is missing the CS frame pin
(this enables the external /CS decoder, otherwise there is no way to de-assert /CS)
You could gain 4 pins by using an inmux module for the 8 GPIO inputs
This needs a 74HC251 external mux and now 4 interface pins (A0,A1,A2 and D)
It also add hardware debouncing and 4 MPG encoders
This decoder I used doesn't have an ena/inh pin so a CS Frame pin wouldn't have anywhere to go. Not being an SPI guru I didn't realize this was necessary, I figured each chip is de-asserted when another is selected via address lines but I gather that you mean it needs a global de-assertion.
I already sent the gerbers out for a prototype spin, I always assume I'll make at least one mistake 1st pass so it's not a huge deal
The docs are a little sparse on hostmot2 BSPI so I'm not sure what it can and can't do (man pages are missing). I've got the decoder selecting 4 10bit ADC's, If I omit 1 ADC that I don't really need, the other 3 decoded CS lines will be de-asserted when it's address is selected (1,1 on the input will select the missing 4th output.
Otherwise I can just remove the decoder for the time being and bodge through the 2 CS lines directly to the chips. I assume no frame pin is required when using straight CS lines. I only actually need the 2 for the machine this is going in. I might be able to get my friend to write the component for it so I'd just like to have something working. Do you know of any docs that explain the BSPI functions or is the 7i65 driver the only thing to go by?
I'll revisit the inmux thing if I have to revise it. I had just enough IO pins in the current layout. If I have to scrounge more IO pins using inmux I will probably drop the decoder since I'd only gain 1 CS line if I have to use a frame pin anyway.
Last edit: 27 Apr 2023 18:40 by blazini36.
Please Log in or Create an account to join the conversation.
27 Apr 2023 19:02 #270076
by PCW
Replied by PCW on topic Question about custom BOB for a 7i92
If you only need 2 outputs from the decoder, the frame signal can go to A1
Please Log in or Create an account to join the conversation.
27 Apr 2023 20:07 #270080
by blazini36
Frame is required for the use of a decoder chip, correct? so it must be a chip with an inhibit/enable
If no decoder is used, no frame is necessary as it's typical SPI usage, correct?
Looking around I noticed reference that there used to be a dbspi driver in linuxcnc besides the bspi driver. I assume this got dripped based on the firmware module being configured specifically for the decoder? If that's the case I assume the (d)bspi version of the firmware always requires a frame pin?
For now what you suggested is probably the easiest thing to deal with. In the future I'll just change or do away with the decoder.
Replied by blazini36 on topic Question about custom BOB for a 7i92
That will probably work for now but just so I'm clear for whatever I do next....If you only need 2 outputs from the decoder, the frame signal can go to A1
Frame is required for the use of a decoder chip, correct? so it must be a chip with an inhibit/enable
If no decoder is used, no frame is necessary as it's typical SPI usage, correct?
Looking around I noticed reference that there used to be a dbspi driver in linuxcnc besides the bspi driver. I assume this got dripped based on the firmware module being configured specifically for the decoder? If that's the case I assume the (d)bspi version of the firmware always requires a frame pin?
For now what you suggested is probably the easiest thing to deal with. In the future I'll just change or do away with the decoder.
Please Log in or Create an account to join the conversation.
27 Apr 2023 20:29 #270083
by PCW
Replied by PCW on topic Question about custom BOB for a 7i92
I would suggest using a '138 decoder and bspi (saves 1 pin)
dbspi (decoded buffered SPI) doest seem to be supported in the hm2 driver
(though adding support would be trivial as it is identical register wise)
dbspi (decoded buffered SPI) doest seem to be supported in the hm2 driver
(though adding support would be trivial as it is identical register wise)
The following user(s) said Thank You: blazini36
Please Log in or Create an account to join the conversation.
27 Apr 2023 21:07 #270084
by blazini36
github.com/machinekit/machinekit-hal/blo...core/src/dbspi.c#L29
The way MachineKit pulls things from LinuxCNC is a mystery to me but it looks like it was written by Andy so at some point it must have existed in LinuxCNC
Replied by blazini36 on topic Question about custom BOB for a 7i92
This exists in MachineKit:I would suggest using a '138 decoder and bspi (saves 1 pin)
dbspi (decoded buffered SPI) doest seem to be supported in the hm2 driver
(though adding support would be trivial as it is identical register wise)
github.com/machinekit/machinekit-hal/blo...core/src/dbspi.c#L29
The way MachineKit pulls things from LinuxCNC is a mystery to me but it looks like it was written by Andy so at some point it must have existed in LinuxCNC
Please Log in or Create an account to join the conversation.
27 Apr 2023 22:01 #270085
by PCW
Replied by PCW on topic Question about custom BOB for a 7i92
The machinekit code is fairly old I, I would either use bspi or update the linuxCNC
driver to support dbspi (there were a lot of recent changes to support bspi properly with Ethernet cards)
driver to support dbspi (there were a lot of recent changes to support bspi properly with Ethernet cards)
Please Log in or Create an account to join the conversation.
29 Apr 2023 20:34 #270234
by blazini36
Replied by blazini36 on topic Question about custom BOB for a 7i92
PCW, any thoughts on adding an external SPI connector on the same channel as the 4 onboard devices?
Not sure if this is a great idea but I started reworking the PCB with the multiplexer and decoder you suggested and since I have a bunch of extra CS lines and a spare pin for MOSI.....
The thought is to use a buffer IC like a CD74HC126 on the external connector as I'm sure the drive strength would be an issue. I have no actual use for this ATM, just "might as well"
Not sure if this is a great idea but I started reworking the PCB with the multiplexer and decoder you suggested and since I have a bunch of extra CS lines and a spare pin for MOSI.....
The thought is to use a buffer IC like a CD74HC126 on the external connector as I'm sure the drive strength would be an issue. I have no actual use for this ATM, just "might as well"
Please Log in or Create an account to join the conversation.
29 Apr 2023 23:18 #270262
by PCW
Replied by PCW on topic Question about custom BOB for a 7i92
Yes, you could add an external SPI port
Note that if you buffer MISO you need to
enable the buffer with the chip select
(and that buffering will slow things down a bit)
Note that if you buffer MISO you need to
enable the buffer with the chip select
(and that buffering will slow things down a bit)
The following user(s) said Thank You: blazini36
Please Log in or Create an account to join the conversation.
Time to create page: 0.154 seconds