PLC – Chosing a cheap, small MCU

My first choise for a MCU for the I2C/SPI Adapter card was STM32F042F6 since I have 4 of these in my stock, but buying these now is a nightmare. Looking at MCU’s I really would like to use STM32G0B1KE, but price difference between ST and Digikey is a 3 x. so what I decided to fall back on is a prototype made with STM32F105Rx MCU’s. I purchased a lot of these some years ago and I need to use them for something. These MCU’s was purchased from Aliexpress, so I might be wasting my time – but, this is for a prototype I can optimize later. Using a LQFP64 rather than a TSSOP20 is a big difference in size, but it will do as a prototype.

The only know issue I have with these MCU’s is that I have not been able to get USB working and while ST say these are 64K I believe mine is of the older 32K batch – but, who cares. They have CAN, I2C, SPI and UART and plenty of juice for this job + I get rid of my stock of 50 or so STM32F105Rx MCU’s – which are too expensive these days!

I can get hold of STM32G0B1KE MCU’s that are 7mm LQFP32 size, but for a price closer to 8.- USD while ST give budgetary price of 1/3 of that. Digikey gone greedy. I bought STM32G491Rx earlier this year for ca 8.- USD, while they now cost 12.- USD on Digikey. Digikey is quick and reliable, but their pricing are extreme these days. I do hope the current semiconductor shortage will come to an end.

One of the drawbacks with these older MCU’s is that you need external crystal. I attempted a USB/CAN converter with this MCU some time back and never got USB working. Firstly I did the istake of not having a crystal, secondly it just never worked – that said I never tried to much either so I don’t know if this was bad batch or design error or something else. I would primarly like to use CAN on this adapter, so I think it is wise to dig up some old cards and see if I can get CAN working first.

The MCU’s I got is mostly RB which is 128Kb Flash, but I also have some 107Rx and 105RC that are compatible. Adding a LQFP64 I probably have space for both CAN and RS485 – it will be nice to use up this stock anyway.

Categories: PLC

Leave a Reply