Starting out with STM32 minimum development board

tigpha

27 Aug 2017, 17:58

Hi DT'ers,

I bought a Pack of 2 STM32f103c8t6 Minimum Development Board, and a ST-Link V2 programmer debugger with the intention of replacing the controller chip in a couple of of IBM PC-XT keyboards.

I've dabbled with a few ATMEL Pro Micro things, with Soarer's Controller, and this works very well indeed with a couple of IBM Bigfoot terminal Model F. These have been my main drivers at work and at home.

I've watched DMA do wonderful stuff with ARM chips on Model F keyboards, and I'd like to try for myself, but first I'd prefer to get used to programming STM32 chips with simpler digital logic circuits before trying to drive the capacitive matrix circuits and puzzling over analogue circuits.

Besides the STM32 boards and the ST-Link, what other hardware would I need?

HuBandiT

28 Aug 2017, 18:42


tigpha

29 Aug 2017, 20:07

Thanks for the answer HuBandiT. The Alt-Ctrl thread is very interesting reading, although the participants already hit the road at mach speed as they're experienced electronic engineers. I begin at pretty much walking pace, and with scarce free time to spare.

NewbieHack has a lot of material for embedded ARM programming beginners like myself. I can also experiment with the RasPi too, at least for matrix scanning, switch debouncing and character maps. The RasPi, at least the old revision I have, doesn't lend itself well to the USB HID side of things. The Pi-Zero might do such USB HID keyboard stuff. It feels like heavy overkill mind you, running an entire desktop Linux s/w stack on a keyboard!

tigpha

29 Aug 2017, 20:13

... And DMA's Common Sense thread too, which is still ticking away...

User avatar
DiodeHead

03 Sep 2017, 11:23

https://shortn0tes.blogspot.com.es/2017 ... p-for.html

maybe this can help. i don´t know if it´s what your looking for. :)

tigpha

04 Sep 2017, 20:00

Hi DiodeHead, Thanks for the link. Slow progress: bathroom hacking takes priority over keyboard hacking!

User avatar
DiodeHead

05 Sep 2017, 08:16

haha dont worry been there.

tigpha

07 Sep 2017, 20:54

Here's something I had not seen mentioned here before: NuttX Real-Time Operating System. It feels less intimidating to me than a hard-core minimal RTOS, resembles Linux, has a BSD licence, and appears to be very well supported and widely used. If it is good enough for Sony to use in their audio products then I feel confident that it should be suitable for keyboards too, no?

I found a very helpful YouTube Nuttx channel where a third piece of equipment is recommended: CP2102 USB to TTL/Serial Module UART to be able to interact with the STM32 device over a serial link console. It also describes in detail the tools necessary to work on the Linux O/S instead of the more common MS-Windows.

This looks like fun.

User avatar
obfuscated

09 Sep 2017, 18:14

The fun think about keyboards is that they are pretty simple, so one doesn't need any kind of OS.
You can do everything in the main loop. :)

tigpha

09 Sep 2017, 22:23

obfuscated wrote: The fun think about keyboards is that they are pretty simple, so one doesn't need any kind of OS.
You can do everything in the main loop. :)
Ah, yes. That was true in the case of the Sinclair Spectrum I cut my coding chops on back in the eighties. The keyboard interface was literally the data lines and address lines on the Zilog Z80 CPU. I learnt a lot about scanning matrices, and built a larger keyboard connected to the Spectrum and wrote the machine code to handle the additional keys. The scan rate on the Spectrum wasn't spectacular, but already I had to deal with key bouncing, and ghosting too because the mylar film matrix had no diodes.

It's not true anymore: the USB HID is not trivial software, and because of this an O/S seems inevitable. I wish to add a storage device to ease uploading keymaps, or I might consider an HTTP web interface for configuration. I also want to add a mouse device, if only to defeat the screensaver on the company laptop by "nudging" the mouse pointer every minute or so.

The ARM microcontrollers are vastly overpowered for keyboard duty, and yet are one of the most economical options. It would be a pity to not expand the software to occupy all available space and power, wouldn't it? :-)

User avatar
obfuscated

13 Sep 2017, 09:05

tigpha wrote: It would be a pity to not expand the software to occupy all available space and power, wouldn't it? :-)
I'm personally striving for simplicity.
I don't know why people waste their time with protocols and apps for configuring the layout.
Especially when they are about to make a single board.

tigpha

14 Sep 2017, 17:25

obfuscated wrote: I'm personally striving for simplicity.
I don't know why people waste their time with protocols and apps for configuring the layout.
Especially when they are about to make a single board.
Simple in use vs. simple implementation are often competing goals. I find that the goal simple-to-use drives up complexity of implementation, and a simple (or simplistic) implementation is hard to use in practice. Keyboard tech might be perceived by most people today to be simple because it's a replaceable commodity peripheral, but it took a lot if time and refinement to become such.

True that it may seem a waste to spend time and effort on a single board, adding features beyond the basic need. But a hobby is just like that -- it's not work, it is not meant to be a product designed to minimal cost and on schedule, to satisfy defined criteria.

This is for fun, after all. I'm sharing because maybe it could be fun for others too.

NuttX on ARM is definitely overkill for a keyboard controller. But it also provides a lot of options without too much effort, it appears. If it can lower the hurdle for microcontroller newbies like me, I consider that to be a bonus.

Post Reply

Return to “Workshop”