Author Topic: Suggestions for a microcontroller (general-purpose)  (Read 12094 times)

0 Members and 1 Guest are viewing this topic.

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 4257
  • Country: us
Re: Suggestions for a microcontroller (general-purpose)
« Reply #75 on: March 09, 2025, 03:32:28 am »
The enhanced mid-range series (16F1xxx and later) have 49 instructions, which include logical shifts (no need to clear Carry, if you don't want it), some very useful addition with carry and subtraction with borrow instructions(1 cycle each),movlp and movlb (PCLATH and Bank respectively) bra, brw, callw, and indirect moviw/movwi with a choice or pre or post increment or decrement of the corresponding FSRn in 1 cycle (with exceptions). 

They don't have some of the nice PIC18F instructions , but it is still better than earlier 14-bit core 16Fxxx chips.  You are still stuck with Banking for SFRs and RAM, but ALL of the user General Purpose RAM can be addressed linearly using an FSRn.  That's nice for buffers.  Common RAM is not affected by that.

EDIT:  I forgot to add that enhanced mid-range (PIC16F1xxx) added direct access to the stack.  STKPTR is in Bank31.  You don't have push and pop as commands per se, but you can do the same thing.
« Last Edit: March 09, 2025, 11:13:16 am by jpanhalt »
 
The following users thanked this post: djsb

Online Tation

  • Regular Contributor
  • *
  • Posts: 148
  • Country: pt
Re: Suggestions for a microcontroller (general-purpose)
« Reply #76 on: March 09, 2025, 08:32:57 am »
Tell you what: when I get some time I'll go back through the now more than 70 replies in this thread and see what you posted. To be honest I have not followed every single link that every poster posted because you know what? I actually have other things to do. Unbelievable, huh?

Exemplary...  :palm:

Yesterday you wrote 15 posts here ¿these are the other things you have to do? It's indecent on your part to continue asking for help just after ignoring the answers people prepared for you. Not nice at all.
 
The following users thanked this post: Smokey, pcprogrammer

Offline beginner_max

  • Newbie
  • Posts: 7
  • Country: de
Re: Suggestions for a microcontroller (general-purpose)
« Reply #77 on: March 09, 2025, 08:35:34 am »
it's ok, everbody do other things. Maybe he will look every few days in this thread, where is the problem.
Then he can answer it.
I don'a see any problem here
 
The following users thanked this post: Analog Kid

Offline Smokey

  • Super Contributor
  • ***
  • Posts: 3310
  • Country: us
  • Not An Expert
Re: Suggestions for a microcontroller (general-purpose)
« Reply #78 on: March 09, 2025, 08:52:07 am »
There's only so many hours in they day... especially when you insist on making things artificially and unnecessarily difficult like writing asm code :)
« Last Edit: March 09, 2025, 08:55:04 am by Smokey »
 
The following users thanked this post: newbrain, beginner_max

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5048
  • Country: nl
Re: Suggestions for a microcontroller (general-purpose)
« Reply #79 on: March 09, 2025, 10:02:13 am »
it's ok, everbody do other things. Maybe he will look every few days in this thread, where is the problem.
Then he can answer it.
I don'a see any problem here

No actually it is not ok. When you ask a question on a forum and then are not bothered enough to read the answers given and just re ask to be given what has already being given plentiful, makes you a dick, at least in my eyes.

We take the time to answer these questions and when you get responses like below, we might get miffed about it. At least I do. If every body was behaving like this guy, I would quickly loose interest in taking the time to help out.

Quote
Tell you what: when I get some time I'll go back through the now more than 70 replies in this thread and see what you posted. To be honest I have not followed every single link that every poster posted because you know what? I actually have other things to do. Unbelievable, huh?

Offline beginner_max

  • Newbie
  • Posts: 7
  • Country: de
Re: Suggestions for a microcontroller (general-purpose)
« Reply #80 on: March 09, 2025, 10:31:54 am »
for me it is ok, any maybe for many others to
I don't understand this drama like a queen:-).
No problem here.
No one need an answer in few hours or a day.
You take time, and he take time, but no one says when you need to take the time.
Are you angry to people, that not ask asap to your WhatsApp or read it?
Maybe it's mor your problem then from other, maybe.
Stay cool
« Last Edit: March 09, 2025, 10:34:09 am by beginner_max »
 

Offline OLderDan

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: Suggestions for a microcontroller (general-purpose)
« Reply #81 on: March 12, 2025, 12:22:36 pm »
After the first two pages of reading most everybody telling OP over and over again NOT to use ASM when this is specifically what he wants to use. It got so painful I skipped here to the end, and no wonder OP has gone awol. Guys, read back over this thread and look at how many times the posts are simply steamrolling over the original question with whatever is the personal flavour of choice.

 There were a few (looking at the awesome pcprogrammer for one) who genuinely seemed to have insightful comments directly relating to the original questions points, but again and again OP was having to reiterate that his choices were simply that, and nothing more, and he was looking for advice relating to his question.

I am just off the back of reading some amazing helpful posts in the beginner section, and loving this place, and so I really hope my post is taken as constructive criticism, as intended.
 

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 736
Re: Suggestions for a microcontroller (general-purpose)
« Reply #82 on: March 12, 2025, 12:57:57 pm »
It's perfectly reasonable to advise why assembly language isn't the best thing to gravitate toward; indeed, the OP himself concluded that RISC-V assembler syntax was too much for him.

Lots of people read threads, not just the thread creator, so if it's directly helpful (which it still is), I don't see why advising against using assembler language for general typical microcontroller usage is a negative thing at all.

It puts people off from wanting to contribute when there's clear rudeness from the original poster.  I actually didn't contribute any suggestions at all because of what I read from the OP, not from the responses from others.

If someone takes the time to give prima facie good advice, then it's basic politeness to at least consider it and see where they are coming from, not state, "You're zero for two," as the OP did to at least one commenter, amid further rudeness to others.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5078
  • Country: nz
Re: Suggestions for a microcontroller (general-purpose)
« Reply #83 on: March 12, 2025, 06:48:08 pm »
It's perfectly reasonable to advise why assembly language isn't the best thing to gravitate toward; indeed, the OP himself concluded that RISC-V assembler syntax was too much for him.

Quite ridiculously, as RV32I is significantly simpler to describe and learn than something like 6502 or Z80, let alone the PIC clone Ubicom SX-28 he says he used before. And then a good order of magnitude easier to actually get things done in. I say this as someone who to this day still writes 6502 and Z80 assembly language code (and have since 1980 or so).

And, yes, the responses to not use asm are annoying, especially from people who clearly are not versed in it themselves and give factually incorrect information, just repeating what they read somewhere.
 

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 736
Re: Suggestions for a microcontroller (general-purpose)
« Reply #84 on: March 12, 2025, 07:09:07 pm »
]And, yes, the responses to not use asm are annoying, especially from people who clearly are not versed in it themselves and give factually incorrect information, just repeating what they read somewhere.

You should know what they say about assumptions and what that makes you.

We know RISC-V coding can be simpler than the archaic processor languages. Had the OP been open to it I might have recommended him a decent book, or shown him a very simple one-page reference.

For a hobbyist with clearly no real interest in machine architecture and just wants to learn how to use a microcontroller, it's pretty clear that there's going to be a lot more hand-holding tutorials for something like C or Python.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5048
  • Country: nl
Re: Suggestions for a microcontroller (general-purpose)
« Reply #85 on: March 12, 2025, 07:39:34 pm »
It's perfectly reasonable to advise why assembly language isn't the best thing to gravitate toward; indeed, the OP himself concluded that RISC-V assembler syntax was too much for him.

Quite ridiculously, as RV32I is significantly simpler to describe and learn than something like 6502 or Z80, let alone the PIC clone Ubicom SX-28 he says he used before. And then a good order of magnitude easier to actually get things done in. I say this as someone who to this day still writes 6502 and Z80 assembly language code (and have since 1980 or so).

I have no idea about the RISC-V assembly, as I have not looked at it yet. Having used 6502, Z80 and 8051 assembly quite a lot back in the day, and you saying it is easier to learn it than those, I should not have any trouble with it then.  :)

The last assembly I looked at was ARM (armv5tej) when I reverse engineered the FNIRSI 1013D. Did not find it to difficult, but writing a full application in it would be cumbersome.

And, yes, the responses to not use asm are annoying, especially from people who clearly are not versed in it themselves and give factually incorrect information, just repeating what they read somewhere.

In a way it is admirable that someone has been writing assembly even on x86 under Windows OS, but also kind a stupid with the availability of higher level languages that perform just as well and allow you to get a large program up and running way quicker, no matter how experienced one is in assembly. Also when it has to be maintained for a longer period of time, by different people, assembly language is not the best choice.

But who are we to judge if someone really wants to do it that way. The op has been presented with several options he asked for. Him not reading them is his business, but ignorantly asking again for the same thing is a no no in my book.

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 1851
  • Country: us
Re: Suggestions for a microcontroller (general-purpose)
« Reply #86 on: March 13, 2025, 03:31:05 am »
In a way it is admirable that someone has been writing assembly even on x86 under Windows OS, but also kind a stupid with the availability of higher level languages that perform just as well and allow you to get a large program up and running way quicker, no matter how experienced one is in assembly. Also when it has to be maintained for a longer period of time, by different people, assembly language is not the best choice.

But who are we to judge if someone really wants to do it that way. The op has been presented with several options he asked for. Him not reading them is his business, but ignorantly asking again for the same thing is a no no in my book.

Well, if I might respond to that (I am the OP here, after all): not sure about "stupid".

With me it's a matter of preference. If you missed it, I'm a hobbyist, not a production programmer: I have no time schedules to adhere to, no need for portability, no list of customer demands, no corporate guidelines, none of that; I'm free to pick the tools I want. And I just prefer assembly language, even for Win32 programs. Not because I like the relief one gets after stopping beating their head against the wall either: I just like the kind of directness I get from clean, working assembly-language code.

And I'm not the only one. It's small, sure, but there's actually a "community" of us weird-ass programmers who prefer to do things this way.

I'm even delving into code that's usually the domain only of C++ programmers: COM programming. It can be done in assembly language, revealing all those "methods" as just entries in a vtable.

To me, it's fun.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5078
  • Country: nz
Re: Suggestions for a microcontroller (general-purpose)
« Reply #87 on: March 13, 2025, 05:06:27 am »
It's perfectly reasonable to advise why assembly language isn't the best thing to gravitate toward; indeed, the OP himself concluded that RISC-V assembler syntax was too much for him.

Quite ridiculously, as RV32I is significantly simpler to describe and learn than something like 6502 or Z80, let alone the PIC clone Ubicom SX-28 he says he used before. And then a good order of magnitude easier to actually get things done in. I say this as someone who to this day still writes 6502 and Z80 assembly language code (and have since 1980 or so).

I have no idea about the RISC-V assembly, as I have not looked at it yet. Having used 6502, Z80 and 8051 assembly quite a lot back in the day, and you saying it is easier to learn it than those, I should not have any trouble with it then.  :)

Looking specifically at RV32I there are only 37 instructions, documented together in a single chapter, you can tell compilers to use it with -march=rv32i.

This is 37 actual instructions to learn, not like 6502's 56 mnemonics, each of which can have up to eight different addressing modes, for 151 total instructions.

There are 32 registers x0-x31 plus PC. All registers are identical and interchangeable except x0 is always equal to 0 (discards attempts to write to it). There is nothing else. In particular, no condition codes or status register.

At the assembly language level there are only four kinds of instructions:

- three registers rd, rs1, rs2:

  - rd = rs1 op rs2 where op is add, sub, and, or, xor, sll, srl, sra, slt, sltu That's 3 shifts, and 2 instructions that compare rs1, rs2 and set rd to 0 or 1

- two registers rd, rs1 plus a sign extended 12 bit constant:

  - rd = rs1 op const where op is the above except sub (add the -ve instead)

  - rd = mem[rs1 + const] with size b, h, w plus unsigned option for b, w (LW, LBU etc)

  - rd = pc + 4; pc = rs1 + const (JALR)

- two registers rs1, rs2, plus a 12 bit sign extended constant

  - mem[rs1 + const] = rs2 with size b, h, w (SW etc)

  - pc = pc + const if rs1 op rs2 where op is eq, ne, lt, ltu, ge, geu  (BNE, BLT etc)

- one register, rd, plus a sign-extended 20 bit constant

  - rd = pc + 4; pc = pc + const (JAL)

  - rd = const << 12 (LUI)

  - rd = pc + (const << 12) (AUIPC)

That is IT. There is nothing more. With this you can efficiently compile all of C/C++ or any other language (using softfp if floating point is needed).

Couple of minor wrinkles:

- conditional branches and JAL support double the range (±4K, ±1M) by representing only even numbers. The binary encoding is a little more complicated than you might expect, but this affects only people writing assemblers or disassemblers or coding in binary/hex by hand.

- link register and stack pointer do not exist in the ISA, any register(s) except x0 can be used for these functions. Standard tools and libraries use x1 for RA (LR) and x2 for SP. Some low level runtime library code uses x5 as a LR to avoid disturbing x1.

- by convention certain registers use the mnemonic aliases a0-a7 (function argument / return / temps), t0-t6 (temps), and s0-s11 (locals preserved over function calls). There is also gp (globals pointer) and tp (thread-local globals pointer).

Congratulation! You now know everything about RV32I.

Quote
The last assembly I looked at was ARM (armv5tej) when I reverse engineered the FNIRSI 1013D. Did not find it to difficult, but writing a full application in it would be cumbersome.

Not a bad ISA, but definitely more complex.

Quote
In a way it is admirable that someone has been writing assembly even on x86 under Windows OS, but also kind a stupid with the availability of higher level languages that perform just as well and allow you to get a large program up and running way quicker, no matter how experienced one is in assembly. Also when it has to be maintained for a longer period of time, by different people, assembly language is not the best choice.

SOMEONE has to know how to write asm, even if only people writing compilers. And emulators. And designing ISAs. And building hardware.

It's not normally an efficient idea to write an entire application in asm in practise. It's too brittle to spec changes. It's unmanageable unless you follow a lot of conventions and boilerplate things in a way that makes code less efficient than a good modern compiler will. And it's non-portable to other ISAs. And will by definition only be optimised for a single µarch of even the same ISA.

But knowing HOW is very useful, as is actually doing it for the odd critical function, especially if your CPU has instructions that don't map easily into C.
« Last Edit: March 13, 2025, 07:52:14 am by brucehoult »
 
The following users thanked this post: SiliconWizard

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 5048
  • Country: nl
Re: Suggestions for a microcontroller (general-purpose)
« Reply #88 on: March 13, 2025, 06:49:34 am »
Well, if I might respond to that (I am the OP here, after all): not sure about "stupid".

Don't get me wrong, I'm not calling you stupid. It is just to refer to the fact that there are options that make life easier when writing code.

For what it is worth, writing proper code is not language related. It is more about logic, and on the almost lowest level there is indeed a more direct link between the logic. (The lowest level is the binary the processor is using)

With me it's a matter of preference. If you missed it, I'm a hobbyist, not a production programmer: I have no time schedules to adhere to, no need for portability, no list of customer demands, no corporate guidelines, none of that; I'm free to pick the tools I want. And I just prefer assembly language, even for Win32 programs. Not because I like the relief one gets after stopping beating their head against the wall either: I just like the kind of directness I get from clean, working assembly-language code.

I did not miss that, as you can see from my posts here https://www.eevblog.com/forum/microcontrollers/suggestions-for-a-microcontroller-(general-purpose)/msg5840515/#msg5840515 and https://www.eevblog.com/forum/microcontrollers/suggestions-for-a-microcontroller-(general-purpose)/msg5841591/#msg5841591

And I'm not the only one. It's small, sure, but there's actually a "community" of us weird-ass programmers who prefer to do things this way.

I'm even delving into code that's usually the domain only of C++ programmers: COM programming. It can be done in assembly language, revealing all those "methods" as just entries in a vtable.

To me, it's fun.

Everything can be done in assembly language, just like I always say that (almost) everything can be done in C. Even object oriented programming can be done in assembly. And if that is what you like, who are we to judge.

I myself would not like to go back on that road again. When needed I can use assembly, but if I can avoid it, I will. For me the clearness of C prevails.

....

Thanks, looks simple enough.

SOMEONE has to know how to write asm, even if only people writing compilers. And emulators. And designing ISAs. And building hardware.

It's not normally an efficient idea to write an entire application in asm in practise. It's too brittle to spec changes. It's unmanageable unless you follow a lot of conventions and boilerplate things in a way that makes code less efficient than a good modern compiler will. And it's non-portable to other ISAs. And will by definition only be optimised for a single µarch of even the same ISA.

But knowing HOW is very useful, as is actually doing it for the odd critical function, especially if your CPU has instructions that don't map easily into C.

Knowing the hardware is always a good thing. I recommend starting programmers to learn a simple ISA first to get some understanding about how the logic works. Can make you a better programmer.

Offline forrestc

  • Supporter
  • ****
  • Posts: 740
  • Country: us
Re: Suggestions for a microcontroller (general-purpose)
« Reply #89 on: March 13, 2025, 09:41:12 pm »
With me it's a matter of preference. If you missed it, I'm a hobbyist, not a production programmer: I have no time schedules to adhere to, no need for portability, no list of customer demands, no corporate guidelines, none of that; I'm free to pick the tools I want. And I just prefer assembly language, even for Win32 programs. Not because I like the relief one gets after stopping beating their head against the wall either: I just like the kind of directness I get from clean, working assembly-language code.

So, I used to code in Assembly and C.   Nowadays, I never bother with Assembly.  Why?

C is essentially portable assembler.   Every line in C can be directly assigned to some assembly directive, and if you look at the output of the C compiler, you'll often find exactly what you'd expect.

a=12;

equates to:

MOVLW 12
MOVWF <address of a>

Once you realize that C is just a way to make assembler portable, C becomes less objectionable.  In addition, modern optimizing compilers will produce output which is better/faster than most hand-written assembly.  It can turn things like:

a=12;
b=10;
c=a*b;

into:

MOVLW 120
MOVWF <address of c>

If a and b are not referenced anywhere else.   There are a lot of other examples.   

I get it if you want to do something with assembly.  It's fun to get down at that level.   But C is so close to assembly that whether you write in assembly or C doesn't matter much. That's what people miss about why C still exists and is widespread - C is how you write what you used to write in assembly.  C is a low-level language.  It's designed to get really close to the underlying hardware.  That's why kernels and embedded and all of those things are still written in C. 

The higher level languages (including some of C++) introduce a layer of abstraction between you and the hardware, which makes it more difficult to actually manipulate the hardware itself. 
 
The following users thanked this post: Picuino

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 1851
  • Country: us
Re: Suggestions for a microcontroller (general-purpose)
« Reply #90 on: March 13, 2025, 11:51:00 pm »
Sorry, not sorry:
I know all about C. Have written much C code (in an earlier life). And I know how low-level it is.
I just prefer assembly. So please, save your breath and don't try to talk me out of it.
 

Offline cunningfellow

  • Contributor
  • Posts: 45
  • Country: au
Re: Suggestions for a microcontroller (general-purpose)
« Reply #91 on: March 14, 2025, 12:30:35 am »
ASM is just much more fun.

I do most my "work" in C (with ASM mixed in if needed).

But when I want to "play" I prefer ASM.

So I def see your point.
 
The following users thanked this post: Analog Kid

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: es
    • Picuino website
Re: Suggestions for a microcontroller (general-purpose)
« Reply #92 on: March 14, 2025, 09:44:00 am »
I think that if you want to program in ASM, that the micro can be used for all types of projects (small, medium, large) with the same instruction set, that it is a bet with future, it is best to bet on the ARM architecture.

There are many manufacturers that use the ARM core. STM32 for example is one of the best known with cheap development boards and a free IDE, very interesting to start with.

https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5078
  • Country: nz
Re: Suggestions for a microcontroller (general-purpose)
« Reply #93 on: March 14, 2025, 10:27:13 am »
I think that if you want to program in ASM, that the micro can be used for all types of projects (small, medium, large) with the same instruction set, that it is a bet with future, it is best to bet on the ARM architecture.

Arm is indeed everywhere, but if you're programming in assembly language then you have to consider that there are in practical terms three different Arm instruction sets that despite family similarities you have to treat quite differently in asm, even for just the the simple integer load/store, add/sub/and/or/xor/shift, compare/branch functionality that you use absolutely everywhere in the code.

If you're using a compiler then you can ignore the differences.

First, the 64 bit ISA is almost completely different to 32 bit. You've got so many registers you'll probably never have to think about running out. With 8 function argument registers (assuming you follow convention, so you can interoperate with library or compiled code) you'll almost never run out except maybe in the most complex printf. It's a very powerful but very complex ISA.

Then in 32 bit, as well as having not very many registers and only four function argument registers -- far easier to run out of -- for the "small" projects the Cortex-M0 is very restrictive to program. You only have full use of eight of the registers. You don't get predication. You don't get combined arithmetic and shift. There are all kinds of different restrictions on immediate values and offsets for different instructions, different offset ranges for load/store of different types. You really have to think quite hard to take full advantage of it.

You can run CM0 code on the medium sized CM3/4/7/33, but it's not going to make the best use of them.

Sure, if you just want to write in asm and have it work then it's not hard -- but if we're not trying to get the most out of the chip and use it at least as effectively as a compiler would, if not better, then why are we even bothering? You really need to understand the nooks and crannies of each variant to get the most out of it.
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: es
    • Picuino website
Re: Suggestions for a microcontroller (general-purpose)
« Reply #94 on: March 14, 2025, 11:29:38 am »
Just thinking about it is tiring.
I much prefer to use C as you would in assembler (with gotos included).
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16302
  • Country: fr
Re: Suggestions for a microcontroller (general-purpose)
« Reply #95 on: March 14, 2025, 12:38:54 pm »
What was really tiring was programming in assembly for the old PIC 8-bitters with their banking system, you had to keep track of the current bank at all times (that is, if you didn't want to incur the penalty of switching banks at every single access which would be horrible).

There is no question as to how using a higher-level language is beneficial for development time and maintenance.

Still, things as complex as compilers and even full OSs have been written all in assembly (something people would rarely bother with these days, but we can mention Menuet OS: https://www.menuetos.net/ ).

For that, you need to document all your routines' interfaces very clearly and thoroughly to make it remotely maintainable. That's a lot of work.
 
The following users thanked this post: Smokey

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1208
  • Country: es
    • Picuino website
Re: Suggestions for a microcontroller (general-purpose)
« Reply #96 on: March 14, 2025, 12:49:24 pm »
PIC 8 bit architecture is horrible for many reasons. The stack to store only 8 addresses in some micros may be another one of them.

In fact C was invented in the early 70's precisely to make Unix portable on machines that then had around 32kbytes up to 256 kbytes of ram memory, which is common today on a mid-range microcontrollers.
« Last Edit: March 14, 2025, 01:11:41 pm by Picuino »
 

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 4257
  • Country: us
Re: Suggestions for a microcontroller (general-purpose)
« Reply #97 on: March 14, 2025, 02:20:37 pm »
PIC 8 bit architecture is horrible for many reasons. The stack to store only 8 addresses in some micros may be another one of them.

Please review the 8-bit, 21st century PIC's released 15 years ago.  The stack is 16 levels and is readable and writable plus several other enhancements as I described earlier in this thread. You may not like the Harvard architecture, but they work it works well, particularly in Assembly.

Edit: Grammer as shown
« Last Edit: March 14, 2025, 09:29:16 pm by jpanhalt »
 

Offline bson

  • Supporter
  • ****
  • Posts: 2568
  • Country: us
Re: Suggestions for a microcontroller (general-purpose)
« Reply #98 on: March 14, 2025, 09:19:57 pm »
About the only architecture I'd recommend against is ESP32 - these are built around Cadence Xtensa, an IP core family with very limited documentation out of NDA.  It's also highly configurable, so each vendor can customize it for their needs.  It has never been intended to be a general-purpose processor so just doesn't have that type of manuals, guides, and documentation.  Espressif also only documents some of their peripherals, at least in English, and you become dependent on using their libraries for anything else.  These factors in combination IMO make the ESP32 family totally unsuitable for tinkering with in assembly.

I'd strongly suggest ARM Cortex-M or RISC-V.  They're easy to work with, are well documented, future-proof, and come in a wide variety of models for everything from operating off a button cell for years, to multi-core monsters running at 600MHz or up.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 5078
  • Country: nz
Re: Suggestions for a microcontroller (general-purpose)
« Reply #99 on: March 14, 2025, 09:44:41 pm »
About the only architecture I'd recommend against is ESP32 - these are built around Cadence Xtensa, an IP core family with very limited documentation out of NDA.

"ESP" is a brand not an ISA. Early members used Xtensa but different variants --  ESP8266 is LX106, the original ESP32 used LX6 and later models LX7.  Recent ESP32, and all future models according to the company, are RISC-V e.g. ESP32-C3, ESP32-C6, and ESP32-P4

Quote
It's [Xtensa] also highly configurable, so each vendor can customize it for their needs.  It has never been intended to be a general-purpose processor so just doesn't have that type of manuals, guides, and documentation.

Correct. And I think Cadence may even not have been very happy when Espressif started supporting customers writing their own code and documenting the ISA so they could do that.

I was once working on software for an embedded product at Samsung. The (internal only!) ISA documentation simply described the instructions and their encodings. I observed that there were both 2-byte and 3-byte instructions and said to myself "that's interesting". I checked against ESP32 documentation. Yup, mostly identical.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf