Hi from Melbourne, Australia

X71
Posts: 28
Joined: Wed Oct 26, 2016 11:53 pm

Hi from Melbourne, Australia

Post by X71 » Sun Oct 30, 2016 10:24 pm

Hi,

New to microcontrollers and electronics. Have been having fun tinkering with Arduino Mega2560 R3 board but I'm actually wanting advice on finding a suitable STM32 board that I can use as a base for my project.

I'm building at game controller for various flight and space simulators and I'm looking for a board that can handle a minimum of 8 analogue inputs flight controls using either hall sensors or potentiometers (looking for 12bit resolution) and 64 (or more) digital inputs for things like push buttons, toggle switches and rotary encoders.

In order for the board to be visible to the simulators' it needs to be seen as a HID Game Controller in Windows, but this is something that is baffling me at the moment. If it helps I do have intermediate coding skills in C/C++/C#.

If possible can anyone make a recommendation and a "solid" seller on eBay / Ali to buy boards from? I'm seeing some examples where the picture doesn't match the delivered product.

Here is an example of what I'm planning to build ...

http://simhq.com/forum/ubbthreads.php/t ... ost4212785

https://drive.google.com/drive/mobile/f ... sp=sharing

Thanks in advance.

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hi from Melbourne, Australia

Post by RogerClark » Mon Oct 31, 2016 12:05 am

There is a branch of the repo which has USB HID and also USB Joystick

https://github.com/rogerclarkmelbourne/ ... addMidiHID

You'd need a STM32F103V or STM32F103Z series board to have that many IO's

Take a look in this page in the wiki

http://wiki.stm32duino.com/index.php?ti ... 103_boards

So a board like this may do the job

http://www.ebay.com.au/itm/STM32F103VET ... SwbsBXnEk0

I can't find the F103ZET from the wiki on either ebay.com.au or AliExpress at the moment.

Some of the F103ZET boards from AliExpress may be OK, but you'd need to see if you can find the schematic and ensure that the USB connectors on them actually have USB data connections, as some boards purely use USB for power, or they connect via a USB to Serial chip on the board, and are useless for HID as you'd need one with a direct USB connection to the STM32


BTW.
You are the 3rd person in the Melbourne area on the from. I think Nick and Lee live either in or around Geelong, and I live in the south eastern suburbs.

X71
Posts: 28
Joined: Wed Oct 26, 2016 11:53 pm

Re: Hi from Melbourne, Australia

Post by X71 » Mon Oct 31, 2016 2:14 am

Cheers Roger.

I live in the western suburbs.

Thinking about it I could break up the design to use separate controllers, as there is a throttle and control column. But the throttle would still need 6 analogue inputs. Also I was thinking of using shift registers for the digital inputs as the majority will be toggle or push button switches.

Would that bring the specs down to a more common board in the F103 line?

Edit: Would I also need an ST link for these board?

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hi from Melbourne, Australia

Post by RogerClark » Mon Oct 31, 2016 3:04 am

You don't need a STLink, you can use the bootloader, but if you use HID there is no way for the IDE to reset the board back into the bootloader, as it normally sends a magic sequence via USB Serial to the sketch, which causes it to reset and hence run the bootloader

So in HID mode you'd need to manually press reset just before each upload, to get it to go back into the bootloader.

And to load the bootloader you need a USB to Serial adaptor of some kind, (you can even use an old Arduino Uno as a USB serial just to install the bootloader)

STLink can be handly however and they are dirt cheap on eBay, (I have at least 3 of them)

If you use STLink, you won't need to press reset before uploading, as STLink directly programs the STM32 via its programming pins SWDIO and SWCLK

Re: Using an F103C

You may be able to use one, but I think the multiplexing is going to be a pain.

You'd be better off buying a bigger board

BTW. I don't know of anyone that has used 6 Analog inputs. I know a lot of people have used 2 Analog inputs and even used DMA to read them in very quickly (which is not what you need).

i.e its just a note of caution, as although it should work with multiple inputs its not something thats been extensively tested.


Id just go for one of the VET boards like

https://www.aliexpress.com/item/STM32F1 ... 80d84fc483

or

The one I have is this one.

https://www.aliexpress.com/item/1PCS-ST ... 80d84fc483


Loads of pins. Far more than I've ever needed to use ;-)

X71
Posts: 28
Joined: Wed Oct 26, 2016 11:53 pm

Re: Hi from Melbourne, Australia

Post by X71 » Mon Oct 31, 2016 5:05 am

Thanks for the advice Roger. Looks like the VET is the way to go, looking at Digikey, are the Nucleo boards considered the "quality" brand of boards? I don't mind spending the money if the boards are of higher quality.

Re the 6 analogue inputs, just to give you an idea, they're used to map to various aircraft engine functions. A throttle on a piston aircraft is not just for allowing more fuel to flow in to the engine, there are also levers that adjust fuel mixture, radiators and the pitch angle of the propellers. They're all usually linked on the throttle quadrant and are actual analogue devices - hence the example pic in my OP :)

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hi from Melbourne, Australia

Post by RogerClark » Mon Oct 31, 2016 5:25 am

Nucleo boards are well made but that don't have direct access to the USB, so are useless for HID.

The quality of most of the cheap boards is generally OK.

There are a few boards I would not touch with a barge pole, (The first STM32 board I bought is junk - the forum now calls it the "Ugly Board")

But most are OK. Occasionally someone fill find one that has bad soldering, but not that often, and those VET boards seem to be reasonable quality.

BTW.
I know what you mean about the flight controls. Many years ago I used to have a private pilots license.

X71
Posts: 28
Joined: Wed Oct 26, 2016 11:53 pm

Re: Hi from Melbourne, Australia

Post by X71 » Mon Oct 31, 2016 6:34 am

Ah, thanks again for the advice. Probably will go for the eBay boards then but buy a few as backup.

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hi from Melbourne, Australia

Post by RogerClark » Mon Oct 31, 2016 7:03 am

As long as things aren't too expensive I normally buy 2 of most things, as it helps when ruling out hardware faults

stevestrong
Posts: 1818
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Hi from Melbourne, Australia

Post by stevestrong » Mon Oct 31, 2016 10:18 am

RogerClark wrote: BTW. I don't know of anyone that has used 6 Analog inputs. I know a lot of people have used 2 Analog inputs and even used DMA to read them in very quickly (which is not what you need).
Just a short comment, I am using 8 analog inputs, dual simultaneous acquisition, write to Sd card with DMA involved, which is optional.
So 8 analog inputs sampling with 10kHz is no problem with a maple mini ;)

X71
Posts: 28
Joined: Wed Oct 26, 2016 11:53 pm

Re: Hi from Melbourne, Australia

Post by X71 » Tue Nov 01, 2016 3:04 am

stevestrong wrote:
RogerClark wrote: BTW. I don't know of anyone that has used 6 Analog inputs. I know a lot of people have used 2 Analog inputs and even used DMA to read them in very quickly (which is not what you need).
Just a short comment, I am using 8 analog inputs, dual simultaneous acquisition, write to Sd card with DMA involved, which is optional.
So 8 analog inputs sampling with 10kHz is no problem with a maple mini ;)
What board are you using?

Post Reply