Question about custom BOB for a 7i92

More
26 Apr 2023 09:18 - 26 Apr 2023 09:21 #269959 by blazini36
This is the pinout I need the firmware for. 

File Attachment:

File Name: 7i92_BoB_p...4-26.txt
File Size:1 KB


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.

More
27 Apr 2023 05:01 - 27 Apr 2023 13:47 #270029 by PCW
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
Last edit: 27 Apr 2023 13:47 by PCW.

Please Log in or Create an account to join the conversation.

More
27 Apr 2023 18:20 - 27 Apr 2023 18:40 #270073 by blazini36

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.

More
27 Apr 2023 19:02 #270076 by PCW
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.

More
27 Apr 2023 20:07 #270080 by blazini36

If you only need 2 outputs from the decoder, the frame signal can go to A1
 

That will probably work for now but just so I'm clear for whatever I do next....

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.

More
27 Apr 2023 20:29 #270083 by PCW
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)
The following user(s) said Thank You: blazini36

Please Log in or Create an account to join the conversation.

More
27 Apr 2023 21:07 #270084 by blazini36

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)
 

This exists in MachineKit:
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.

More
27 Apr 2023 22:01 #270085 by PCW
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)

Please Log in or Create an account to join the conversation.

More
29 Apr 2023 20:34 #270234 by blazini36
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"

Please Log in or Create an account to join the conversation.

More
29 Apr 2023 23:18 #270262 by PCW
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)
The following user(s) said Thank You: blazini36

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.154 seconds
Powered by Kunena Forum