Alternative microcontroller to PIC

Thread Starter

AlbertHall

Joined Jun 4, 2014
12,345
I have been trying an ambitious project. I am used to 8 bit PICs but I needed around 48k of ram so I tried a PIC24 which has the required ram but have encountered various problems with the IDE and the XC16 compiler.

Can you suggest an alternative micro with an IDE, programmer, compiler, and debugger (single stepping, viewing and changing values, etc) that I could attempt instead. I'll even part with money for a good alternative!
 

Ian0

Joined Aug 7, 2020
9,670
NXP LPC series.
Free compiler/assembler (MUCXpresso), it even works on Apple and Linux
Cheap (£20) debugging probe.
Parts cost starting at £0.50.
 

BobTPH

Joined Jun 5, 2013
8,813
I use PIC24 almost exclusively now, and have had no problems with the tools. What kind of problems are you having?

Bob
 

BobTPH

Joined Jun 5, 2013
8,813
The PIC24 has an option to map program memory onto RAM. Perhaps you are using up much of the RAM space with mapped program memory. I will investigate later and see what the default is. It looks like, from the thread on the PIC forum, it might be split with 24K each.

Bob
 

nsaspook

Joined Aug 27, 2009
13,086
How difficult should it be to create a few arrays?
Small controllers usually don't have a large linear memory model. Segments are the norm with the hll usually hiding the details to some point. The C array model is not a exact fit for lots of hardware so most 16-bit and below controllers have specific modes to allow larger contiguous memory. This is something the embedded programmer must account for.
 
Last edited:

Thread Starter

AlbertHall

Joined Jun 4, 2014
12,345
Small controllers usually don't have a large linear memory model. Segments are the norm with the hll usually hiding the details to some point. The C array model is not a exact fit for lots of hardware so most 16-bit and below controllers have specific modes to allow larger contiguous memory. This is something the embedded programmer must account for.
In this case the biggest array is less than 3k.
XC16 has a large array switch which made no difference to this problem.
 

MrChips

Joined Oct 2, 2009
30,712
My MCU of choice would be STM32, with minimum 128Kbytes of RAM on STM32L476.
STM32F407 has 196KBytes of RAM.

For development, you can choose STM32 Nucleo-64 or STM32F4-Disco.
STM32CubeIDE is free.
I prefer to use IAR EWARM which you can run for free in either time limited mode or code size limited mode.
 

John P

Joined Oct 14, 2008
2,025
An alternative approach might be to use an external memory chip. It would depend on how rapidly you need to access the RAM data, but if you only plan to build this thing once and you'd be able to stick with a familiar processor, it might be worth doing. Or even if it's a product to be built in quantity, maybe you'd be able to save money if you can use a smaller processor and add the additional part.

Like this?
https://www.microchip.com/wwwproducts/en/23A512
 

nsaspook

Joined Aug 27, 2009
13,086
In this case the biggest array is less than 3k.
XC16 has a large array switch which made no difference to this problem.
When I read your comments on the mchp site about using the eds attribute to better control the code generation it seems to me you're on the way to understanding what's needed to configure the compiler to generate correct code to your requirements.
 

BobTPH

Joined Jun 5, 2013
8,813
If
Small controllers usually don't have a large linear memory model. Segments are the norm with the hll usually hiding the details to some point. The C array model is not a exact fit for lots of hardware so most 16-bit and below controllers have specific modes to allow larger contiguous memory. This is something the embedded programmer must account for.
PIC24 has a linear data address space.

Bob
 

BobTPH

Joined Jun 5, 2013
8,813
No it doesn't. All RAM above 0x800 is available to the user with no gaps. Of course, the gcc based compiler puts things into sections and allocates them, but that is not different than windows or linux.

Bob
 

nsaspook

Joined Aug 27, 2009
13,086
No it doesn't. All memory above 0x800 is available to the user with no gaps.

Bob
I'm only talking about how xc16, C arrays and the linker are assigned by default if you create variables in C. The OP was having problems with the compiler allocating memory space for his variables. I'm not sure why because I didn't see his code but he seems to have found a workaround using a specific data space attribute on the arrays.
 
Last edited:
Top