Choosing a controller

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

dflogeras
Posts: 235
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Choosing a controller

Post by dflogeras »

Hi, rather than a ChibiOS specific question, I'd like to draw on others experience to help me choose a uC that ChibiOS supports.

My main concern is that ChibiOS support is mature for the device, and that it is easy for someone to hand solder the part, so ideally DIP or SOIC parts. Traditionally I use STM32 parts, but the application in this case would probably require someone who isn't skilled at hand soldering LQFP. The application will potentially require more than a few units, but probably less than would be worth paying a board shop to stuff higher density parts.

Other nice-to-haves would be:
- gcc/open toolchain support
- inexpensive devkit, preferably with chibi demo support
- easy to program (I'm used to using a $10 stm32-value devkit as my 'programmer'), and not require a $200 jtag

I don't need any heavy duty processing, really just four or five IOs and perhaps a timer. Power consumption isn't my greatest concern, any uC will be better than the current solution. It will spend 99.99% of the time asleep.

So what parts have people used with ChibiOS with success that fits most/all of this criteria?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Choosing a controller

Post by Giovanni »

The most complete support right now is STM32, I doubt you will find many DIL devices there however :)

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Choosing a controller

Post by steved »

The STM32F051 range has some 32-pin LQFP packages available; while still surface mount, the pins are relatively widely spaced (same basic package size as the 48-pin).

May well be similar options in the STM32F03X range.

I've got a couple of applications running 24/7 on 32F051 without problem; they are the most mature part in the 32F0XX range.
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: Choosing a controller

Post by barthess »

Some STM32 have TSOP-20 package.
dflogeras
Posts: 235
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Choosing a controller

Post by dflogeras »

Thanks for the replies so far.

I see about the LQFP32 packages, seems quite easy for someone novice to handle. The STM32F0x packages available to me via element14 are at most 8K RAM, is that enough to run a pretty stripped version of ChibiOS? I can always get a more capable devkit for debugging.

On the same note but what barthess suggested, the TSOP20 packages available to me are all 4K. Is it even possible to get Chibi onto a device that limited? These are appealing to me both for ease of installation, as well as price.

Dave
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Choosing a controller

Post by Giovanni »

8kB are plenty, I ported it on devices with 2kB. There is also the NIL option, it uses even less RAM, you can also use just the HAL without RTOS.

Of course it depends on your application.

Giovanni
dflogeras
Posts: 235
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Choosing a controller

Post by dflogeras »

So one of the F0xx TSOP20 with 4K RAM would most likely be OK since I will not need any serial/i2c/spi/etc, probably just GPIO and maybe a timer (probably can get away with virtual timer in this application anyway, so no hardware driver even). I don't even imagine needing more than the main thread.

I could probably get away with using an STM8 and no OS, but I am comfortable with Chibi and it really does speed development up (testament to your design GIovanni!). Also I am not sure the quality of SDCC compiler.

I have access to F030, F031, F050 and the F070 which actually has 6K RAM. I will probably buy a STM32F0 discovery to start playing with and trim down to one of these devices. Does that sound reasonable?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Choosing a controller

Post by Giovanni »

It is a good idea, use a bigger STM32 for development and THEN decide the final device, code is mostly compatible.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: Choosing a controller

Post by steved »

Firstly, are you likely to be constrained by RAM or by ROM?

Just to give you an idea, I'm running a 32F051 (64K ROM, 8K RAM). Using both serial ports, running a simple protocol handler and a fairly extensive command processor. Using both I2C running one wire bus (with C++ classes) plus a bit of FRAM. RTC, analog input handler. That lot exceeds the 64K with no optimisation; comfortably in at 42K with -O2. I'm using all the RAM, because I have configured it that way - I could use lots more! I did find that the EXTI handler (external interrupts) took a relatively large amount of memory (>1K IIRC) so I hard-coded the RTC interrupt handling.
dflogeras
Posts: 235
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Choosing a controller

Post by dflogeras »

Until I get going I wont better know my requirements, I just wanted to know if a small project was feasible in 4K of RAM. On the flash side, historically, my projects of larger magnitude fit fine inside of 16K of flash. Worst case, is if I need to debug and begin running shy on flash space, I will have a cheater-board with a higher spec chip.

What is the best way to get an idea of RAM/stack usage? Use CH_DBG_FILL_THREADS and then do the arithmetic on the __XYZ_stack_base and __XZY_stack_end?
Post Reply