Jump to content

Freejoy + shift register + ADC converter


Jocman

Recommended Posts

Hi all.

As my home cockpit is getting on (my wife says she can see the light at the bottom of the tunnel, but I honestly not yet....), I' starting to work on the home made controls (cyclic, collective, rudder).

Freejoy is my choice for the quest, so I started etching the PCBs.

The cyclic is based on 2 shift register 75HC165 daisy chained, the collective on 3 shift register 75HC165 daisy chained: every PCB will host the shift registers..

As I will need 6 analog axis, I wish to ad an MCP3208 DAC.

The PCBs for cyclic and collective are done, now I'm working on the main PCB (ST32 + MCP3208).

Now my doubt: how to connect the MCP3208?

The shift registers can share clock and load pins, the cyclic will have ad additional Input 1 pin, and the collective an additional Input 2 pin.

As the MCP3208 owns a Clock and Load pins too, can these be shared with the 75HC165, or they need separate pins?

As you can see, I planned to share the MCP3208 Clock pin with the 75HC165: is this correct?

Attached a schematic related to second option (MCP3208 on separate pin).

Your opinion and suggestion are obviously welcome.

Thanks

JocmanPCB_Freejoy.jpg


Edited by Jocman

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Why not just use a Leo Bodnar BU0836A?
It has eight 12-bit analogue channels and up to 32+4 digital button inputs.
It requires no programming (unless you want to change its name or use the rotary encoder functions), and plugs straight into a USB port.

Link to comment
Share on other sites

Yep, you're right, this could be an easy and maybe more reliable solution, even thouh I've to read the doc, considering I made the slave boards (with the 74HC165 chains) and see how to wire them to the card.

What can I say? DIY sickness? 😁

Anyway, as I already made the 2 slave PCBs and got the DAC,  I'd like to try the quest.

Keeping studing, maybe the solution to my question could be:

- cyclic shift register chain CLK + collective shift register chain CLK + MCP3208 CLK > all to SPI SCK pin on STM32

- cyclic shift register chain DOut + collective shift register chain DOut + MCP3208 DOut > all to SPI MISO pin on STM32

- cyclic shift register chain Latch > to pin X on STM32

- collective shift register chain Latch > to pin Y on STM32

- MCP3208 Latch > to MCP3208 CS on STM32

 

Could this work?

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

@Jocman

I don't have the required permissions to send you an invite to the HOTAS/HOSAS/SIMPIT Discord, but I'm sure if you do a little googling or possibly post in the hotasdiy subreddit, somebody should be able to help you join.  There's a channel dedicated to Freejoy there, and the dev seems to post pretty regularly.

Link to comment
Share on other sites

On 2/8/2024 at 2:14 PM, No1sonuk said:

Doesn't the STM32 have ADCs?

As I understood, the STM32 analog input are working but the resolution isn't the best, so using an external ADC fix the problem and gives a better resolution

On 2/9/2024 at 12:10 AM, Biggus said:

@Jocman

I don't have the required permissions to send you an invite to the HOTAS/HOSAS/SIMPIT Discord, but I'm sure if you do a little googling or possibly post in the hotasdiy subreddit, somebody should be able to help you join.  There's a channel dedicated to Freejoy there, and the dev seems to post pretty regularly.

I'll have a search for discord. Anyway, reading the freejoy documentation it seems that (as in my previous post) the wiring could be as descripted.

But before etching a PCB I'll try on discord channel (hoping to get into...)

  • Like 1

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

STMF2: 

" 3 × 12-bit, 0.5 µs ADCs with up to 24 channels and up to 6 MSPS in triple interleaved mode"

 

MCP3204:

12-bit resolution • ± 1 LSB max DNL • ± 1 LSB max INL (MCP3204/3208-B) • ± 2 LSB max INL (MCP3204/3208-C) • 4 (MCP3204) or 8 (MCP3208) input channels • Analog inputs programmable as single-ended or pseudo-differential pairs • On-chip sample and hold • SPI serial interface (modes 0,0 and 1,1) • Single supply operation: 2.7V - 5.5V • 100 ksps max. sampling rate at VDD = 5V • 50 ksps max. sampling rate at VDD = 2.7V

 

Plus, MCP3204 has an SAR (the most basic ADC kind)... Although STMF2 datasheet doesn't say what kind of ADC it is... but by the 6msps number, it's unlikely an SAR. Also, since the ADC is an inbuilt ADC supporting DMA, it's clearly much faster in reading the data. You can probably read up to 6 million samples per second, and set it to read sample/read/transfer multiple channels all automatically. I did exactly that in Hempstick.

 

Anyway, clearly STM's on-die ADC is much better than the MCP3204... on paper. What's unfortunately for you is that the STMF2 costs $12+ a pop... the STMF0 ($2.50) has a crappier ADC and doesn't say exactly what sample rate it has (but still 12bit, can't be worse than MCP3204's bare minimum of 12 bit, 100ksps.). You just have to pick the right STM MCU with the right ADC.

Link to comment
Share on other sites

23 hours ago, Hempstead said:

Plus, MCP3204 has an SAR (the most basic ADC kind)... Although STMF2 datasheet doesn't say what kind of ADC it is... but by the 6msps number, it's unlikely an SAR. Also, since the ADC is an inbuilt ADC supporting DMA, it's clearly much faster in reading the data. You can probably read up to 6 million samples per second, and set it to read sample/read/transfer multiple channels all automatically. I did exactly that in Hempstick.

This:
https://wiki.st.com/stm32mcu/wiki/Getting_started_with_ADC

Says: 

Technology 12-bit successive approximation
Conversion time 188 nS, 5.33 Msamples/s (when fADC_CLK = 80 MHz)

That's better than the standard 10-bit ADCs of Arduinos, and on-par with Leo Bodnar analogue boards.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...