Author Topic: Suggestions for microprocessor module  (Read 8580 times)

0 Members and 7 Guests are viewing this topic.

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5357
  • Country: ro
  • .
Re: Suggestions for microprocessor module
« Reply #50 on: August 29, 2026, 06:26:19 am »
Jesus christ ... get a breadboard and a 4-5 pin header or replace breadboard with a stripboard if you have soldering iron - example https://www.ebay.com/itm/376176460955  or https://www.ebay.com/itm/398087349511

You have that Microchip SNAP for 10-12$ that can program PICs, Atmel parts, and some other ICs, you need 4-5 wires to the board to program the micro.

You have 800+ DIP packages , PICs and Atmel , you can program all in assembler :  https://www.digikey.com/short/j2qthwmp

Some of the more old PICs and low pin count (ex maybe pic10f) may not be supported by the SNAP but older programmers will work (basically SNAP only works with chips that can be programmed using low voltage, all the more modern ones support low voltage programming)
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #51 on: August 29, 2026, 07:08:35 am »
Jesus christ ... get a breadboard and a 4-5 pin header or replace breadboard with a stripboard if you have soldering iron - example https://www.ebay.com/itm/376176460955  or https://www.ebay.com/itm/398087349511

OK. So if I want to go this route, could you maybe supply specifics?
Like specific chips, programmers, software? So I don't have to hunt them down?

I still have some SX-28 chips, no programmer, but they don't have enough I/O pins, so time to move on to something else.

I do have breadboards, soldering iron, all that: however, I like the idea of a dev board w/chip to simplify things. (Previously I assembled my SX-28 projects on perfboard, soldered.)
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 13125
  • Country: us
Re: Suggestions for microprocessor module
« Reply #52 on: August 29, 2026, 07:22:54 am »
So I have not done anything like this, but if I were to do so, I think I would look at an Arduino. A nice convenient dev board with peripheral interfaces on it, a competent microprocessor, and plenty of ways to program it.
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 2170
  • Country: au
Re: Suggestions for microprocessor module
« Reply #53 on: August 29, 2026, 07:39:34 am »
So I have not done anything like this, but if I were to do so, I think I would look at an Arduino. A nice convenient dev board with peripheral interfaces on it, a competent microprocessor, and plenty of ways to program it.
Specifically, whilst the majority of the Arduino programming ecosystem is based around C language, for the OP's requirements, the Arduino can definitely be programmed in assembly, which raises another important question.

Will the OP be relying on assembly language modules and libraries developed by the community?  Or will the OP be coding assembly from scratch?

If the OP is looking for community assembly code examples and snippets, they may struggle to find a large codebase beyond PIC.  Pretty much everyone has moved on to C.

The lack of a large assembly codebase also means less training material for AI tools, which may be more error prone with generating assembly language, compared to AI generated C code.  This may be a moot point if the OP won't be using AI.
« Last Edit: August 29, 2026, 07:42:05 am by Andy Chee »
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #54 on: August 29, 2026, 07:55:02 am »
Specifically, whilst the majority of the Arduino programming ecosystem is based around C language, for the OP's requirements, the Arduino can definitely be programmed in assembly, which raises another important question.

Will the OP be relying on assembly language modules and libraries developed by the community?  Or will the OP be coding assembly from scratch?

From scratch.

"Libraries? Libraries? We don't need no steenkin' libraries!"
I know how to roll my own stuff. Not doing anything spectacular on a dinky micro, leave that stuff for my PC.

And no goddamned "AI" either.
« Last Edit: August 29, 2026, 08:46:11 am by Analog Kid »
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #55 on: September 22, 2026, 08:36:59 pm »
I'm back to square one, searching for a microprocessor and all the associated hardware and software I need to run it.

I need to give @brucehoult a show of appreciation for his attempts to help me. Unfortunately, they ended up going down a rabbit hole into GitHub, a place I'm not prepared to go. So thanks for your help.

Here's what I want:
  • A modren microprocessor, not something ancient like the 8051.
  • 8/16/32 bits; I guess the more the merrier, but no specific requirements ATM
  • Lots of I/O pins; 32 would be nice if possible
  • USB-accessible programmer
  • Software to run under Windows (W7):
    I don't need an IDE, though that would be OK; running from the command line is fine.
    I just need to be able to assemble, link and run programs, and copy them to EPROM
  • I need an assembler for the μp. I don't want to program in C (or Python or anything else):
    I want to program in the chip's native assembly language.

    This is non-negotiable, so don't bother trying to talk me out of it, 'k?

I think that about covers it.
Hopefully whatever software I need will be downloadable as binaries; I don't want to have to compile anything here.

So if you know of a microprocessor and associated stuff, I'd ask you to please provide links to specific items (say on AliExpress) as well as links to the necessary software.

I can't be the only person out there who wants to program in assembly.

Thanks in advance.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #56 on: September 22, 2026, 11:17:20 pm »
For the benefit of others, the requirements not stated above include:

- must be a single self-contained download and install/unpack on virgin Windows 7

- doesn't want to make a separate install of prerequisites or tools such as mingw, git, make, curl/wget, Microsoft developer tools such as WSL, WinGet, CoreUtils

Does even AVR with Arduino IDE reach that standard?  (anything other than AVR requires entering a support package URL into a Arduino IDE dialog box)
« Last Edit: September 22, 2026, 11:20:35 pm by brucehoult »
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #57 on: September 22, 2026, 11:30:02 pm »
For the benefit of others, the requirements not stated above include:

- must be a single self-contained download and install/unpack on virgin Windows 7

Almost. I don't mind downloading multiple things.
The point is that I want to be able to download ready-to-run binaries, not source that I have to make into executables.

Quote
- doesn't want to make a separate install of prerequisites or tools such as mingw, git, make, curl/wget, Microsoft developer tools such as WSL, WinGet, CoreUtils

That's accurate.
Is that unrealistic?
Tell us; does the average hobbyist Arduino or equivalent user even know how to deal with those tools in that environment? Don't they use more-or-less easily obtainable software, either IDE-based or command-line, without having to acquaint themselves with that whole mess?
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #58 on: September 22, 2026, 11:55:09 pm »
The point is that I want to be able to download ready-to-run binaries,

Everything I pointed to is binaries.

Except of course for the header files that you'd #include in your assembly code to tell you where peripherals are.

Quote
not source that I have to make into executables.

The only making of source into executables is assembling YOUR asm code into (in that case) RISC-V binaries.

No x86 compilers or assemblers are needed.

Yes, it will build minichlink from the included source code if you don't already have it, but you can download a binary e.g. from here:

https://github.com/AlexanderMandera/minichlink-binaries

Quote
does the average hobbyist Arduino or equivalent user even know how to deal with those tools in that environment?

The average Arduino hobbyist doesn't program in asm.

As I pointed out in my original reply, the first reply to this post, you can use the Arduino IDE if you want. I even said it's the easiest way.

https://www.eevblog.com/forum/embedded-computing/suggestions-for-microprocessor-module/msg6342554/#msg6342554
« Last Edit: September 22, 2026, 11:57:52 pm by brucehoult »
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #59 on: September 23, 2026, 12:40:22 am »
Maybe I'll give this one more try.

Let me back up a couple steps here:
What exactly do I need in terms of software here?
I assume I need:
  • An assembler + linker for the micro
  • A program to upload my assembled + linked code to the micro
  • A program to execute my code on the micro (or is that part of the loader above?)
Once we establish exactly what I need, then let me ask where to obtain those parts/pieces.
(Which may come from different places)
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #60 on: September 23, 2026, 12:54:24 am »
Maybe I'll give this one more try.

Let me back up a couple steps here:
What exactly do I need in terms of software here?
I assume I need:
  • An assembler + linker for the micro

xPack GNU RISC-V Embedded GCC

Quote
  • A program to upload my assembled + linked code to the micro

minichlink  (openOCD is also possible, but it's generic and needs a lot of config while minichlink is specialised)

Quote
  • A program to execute my code on the micro (or is that part of the loader above?)

Your code runs on reset. Or, actually, I think on first upload minichlink just jumps to it, which allows you to link your code to run from RAM instead of flash if you want, which is faster, but then it's lost on a reset.

Quote
Once we establish exactly what I need, then let me ask where to obtain those parts/pieces.

Already provided to you.

ch32fun provides definitions for the hardware in the various WCH chips, and provides scripts to manage calling the compiler/assembler with the right flags, the right linker flags, call minichlink to upload to the micro etc.

You don't need it, you can figure out everything by yourself, but it will save tens of hours grovelling through a lot of manuals and a lot of hair-pulling.
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #61 on: September 23, 2026, 01:27:49 am »
I just installed (I think) the "Prebuilt Windows Toolchain for RISC-V" from https://gnutoolchains.com/risc-v/;
Looking in that folder, I have SysGCC/riscv/xxx.
The bin folder contains make.exe plus a lot of riscv64-unknown-elf-xxx executables.

Am I headed in the right direction? Not sure what I have here ...
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #62 on: September 23, 2026, 01:58:24 am »
I just installed (I think) the "Prebuilt Windows Toolchain for RISC-V" from https://gnutoolchains.com/risc-v/;
Looking in that folder, I have SysGCC/riscv/xxx.
The bin folder contains make.exe plus a lot of riscv64-unknown-elf-xxx executables.

Am I headed in the right direction? Not sure what I have here ...

Ah, yeah, that looks like a reasonable alternative to xPack. The binutils and gcc are 6 1/2 year old versions is the only thing, but that should be OK for assembly language programming on a CH32V003 ... in particular RV32E support went in two years before that.

Make a text file containing .. idk ....:

Code: [Select]
            .globl _start
    _start: mv a1, a0
            li a0, 1
            beqz a1, 1f
    0:      mul a0, a0, a1
            addi a1, a1, -1
            bnez a1, 0b
    1:      ret

Then run ...

Code: [Select]
riscv64-unknown-elf-gcc -c foo.s
riscv64-unknown-elf-objdump -d foo.o

... and you should see the assembled code.

It will be RV64 code, but that's ok for a first test.  You'll want to add " -march=rv32ec -mabi=ilp32e" for the microcontroller (which btw if it's the base model CH32V003 doesn't have multiply, but the 002, 004, 006 do)

Or try ...

Code: [Select]
riscv64-unknown-elf-gcc -march=rv32emc -mabi=ilp32e -nostartfiles foo.s -o foo
riscv64-unknown-elf-objcopy -O ihex foo foo.hex

.. and then look at foo.hex
« Last Edit: September 23, 2026, 02:00:56 am by brucehoult »
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #63 on: September 23, 2026, 02:50:50 am »
I created that code in a file named foo.s. Tried this:
Code: [Select]
[e:\programming stuff\assembly language\ch32]bin\riscv64-unknown-elf-gcc -c foo.s
riscv64-unknown-elf-gcc: fatal error: cannot execute 'as': CreateProcess: No such file or directory
compilation terminated.

?????

What is "as"?
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #64 on: September 23, 2026, 03:01:12 am »
I created that code in a file named foo.s. Tried this:
Code: [Select]
[e:\programming stuff\assembly language\ch32]bin\riscv64-unknown-elf-gcc -c foo.s
riscv64-unknown-elf-gcc: fatal error: cannot execute 'as': CreateProcess: No such file or directory
compilation terminated.

?????

What is "as"?

as is the actual assembler. But it should be calling riscv64-unknown-elf-as not just as.

Do you have riscv64-unknown-elf-as

It's suspicious that the 10.1.0 download is 22 MB vs 7.7.1 at 141 MB. Maybe it doesn't have binutils. But gcc 7 for RISC-V is waaay too old to even think about using today — gcc 9 or 10 is fine. But 13+ is better!

Also, as I already said, that package is clearly old and not maintained. I don't know why you'd want to use it instead of the xPack I already reccomended and gave you a link for.

The ch32fun install script downloads and installs a known-good xPack for you.

It feels like you're trying to make this harder than it needs to be, doing everything except what is recommended.
« Last Edit: September 23, 2026, 03:08:38 am by brucehoult »
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #65 on: September 23, 2026, 03:24:20 am »
The ch32fun install script downloads and installs a known-good xPack for you.

Then that sounds like what I want.
Sorry, but could you give me a link to it again and tell me what exactly to download and run? I'm getting confused with all these links here.

Quote
It feels like you're trying to make this harder than it needs to be, doing everything except what is recommended.

Not doing that intentionally. I await further instructions ...

OK, just so I don't appear too clueless here, is this the file you want me to download?
https://github.com/cnlohr/ch32fun/blob/master/misc/install_xpack_gcc.ps1

The one that starts
Code: [Select]
using namespace System.IO;
using namespace System.IO.Compression.FileSystem;

[CmdletBinding(DefaultParameterSetName = 'DestPreset')]
param (
# Uses one of the preset locations to install to
[Parameter(ParameterSetName = 'DestPreset', Position = 0)]
[ValidateSet('User', 'System')]
[string]$Destination = 'User',

# If a preset location is not used, then the user must specify a path to install to
[Parameter(ParameterSetName = 'DestPath', Position = 0, Mandatory = $true)]
[string]$Path,

# If enabled, will prevent modification of your PATH environment variable
[switch]$NoPath,

Once I download it, what do I do with it?

BTW, I got that file to assemble:
Code: [Select]
[e:\programming stuff\assembly language\ch32\bin]riscv64-unknown-elf-objdump -d foo.o

foo.o:     file format elf64-littleriscv

Disassembly of section .text:

0000000000000000 <_start>:
   0:   85aa                    mv      a1,a0
   2:   4505                    li      a0,1
   4:   c589                    beqz    a1,e <.L1^B1>

0000000000000006 <.L^B1>:
   6:   02b50533                mul     a0,a0,a1
   a:   15fd                    addi    a1,a1,-1
   c:   fded                    bnez    a1,6 <.L^B1>

000000000000000e <.L1^B1>:
   e:   8082                    ret

Problem was I was running gcc from a folder above where the binaries were and it couldn't find the other ones (no path set).

Should I still abandon this stuff and go ahead with what you're suggesting?
« Last Edit: September 23, 2026, 04:20:51 am by Analog Kid »
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #66 on: September 23, 2026, 04:42:00 am »
The ch32fun install script downloads and installs a known-good xPack for you.

Then that sounds like what I want.
Sorry, but could you give me a link to it again and tell me what exactly to download and run? I'm getting confused with all these links here.

Quote
It feels like you're trying to make this harder than it needs to be, doing everything except what is recommended.

Not doing that intentionally. I await further instructions ...

OK, just so I don't appear too clueless here, is this the file you want me to download?
https://github.com/cnlohr/ch32fun/blob/master/misc/install_xpack_gcc.ps1

Nooooooo.

You need EVERYTHING there.

Install a git client — CLI or GUI as you prefer — and do "git clone https://github.com/cnlohr/ch32fun.git".

And then follow the instructions in the README.

Quote
BTW, I got that file to assemble:
Code: [Select]
[e:\programming stuff\assembly language\ch32\bin]riscv64-unknown-elf-objdump -d foo.o

foo.o:     file format elf64-littleriscv

Disassembly of section .text:

0000000000000000 <_start>:
   0:   85aa                    mv      a1,a0
   2:   4505                    li      a0,1
   4:   c589                    beqz    a1,e <.L1^B1>

0000000000000006 <.L^B1>:
   6:   02b50533                mul     a0,a0,a1
   a:   15fd                    addi    a1,a1,-1
   c:   fded                    bnez    a1,6 <.L^B1>

000000000000000e <.L1^B1>:
   e:   8082                    ret

Problem was I was running gcc from a folder above where the binaries were and it couldn't find the other ones (no path set).

That's good.

I'm kind of assuming here that you know how to deal with things like PATH in the Windows registry or whatever they've replaced it by by now.

Quote
Should I still abandon this stuff and go ahead with what you're suggesting?

It's good that it works, but yes it would be better if you let ch32fun set things up for you.

Since you don't want to compile minichlink you should download and install that (and put it in your PATH) first, so it doesn't try to built it for you using a Windows compiler you don't have.
 

Online Analog KidTopic starter

  • Super Contributor
  • ***
  • Posts: 5085
  • Country: us
  • DANDY fan (Discretes Are Not Dead Yet)
Re: Suggestions for microprocessor module
« Reply #67 on: September 23, 2026, 06:29:20 am »
Install a git client — CLI or GUI as you prefer — and do "git clone https://github.com/cnlohr/ch32fun.git".

I was about to do that. Then I saw there are many clients out there.
Any one in particular you can suggest? (For Windoze.)
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #68 on: September 23, 2026, 07:21:57 am »
Install a git client — CLI or GUI as you prefer — and do "git clone https://github.com/cnlohr/ch32fun.git".

I was about to do that. Then I saw there are many clients out there.
Any one in particular you can suggest? (For Windoze.)

No, I don't use Windows. And if I did I'd use WSL.

I'd just Google it. You can too.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3921
  • Country: it
Re: Suggestions for microprocessor module
« Reply #69 on: September 23, 2026, 07:58:57 am »
Any one in particular you can suggest? (For Windoze.)

https://gitextensions.github.io/

(wish i could have it on linux. Gitte looks promising as a replacement, but libadwaita. ick.)
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #70 on: September 23, 2026, 08:29:56 am »
Any one in particular you can suggest? (For Windoze.)

https://gitextensions.github.io/

(wish i could have it on linux. Gitte looks promising as a replacement, but libadwaita. ick.)

Required: .NET 10.0 Desktop Runtime v10.0.9 x64 or later 10.x

Windows 7 supports up to .NET Framework 4.8 and modern .NET Core/.NET 6
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5116
  • Country: gb
Re: Suggestions for microprocessor module
« Reply #71 on: September 23, 2026, 09:32:23 am »
Quote
Doing asm only is mostly a sign of some sort of mental self-harm condition.
Maybe you should contact the TEA group.

May I ask your permission to use this phrase and print it on T-shirts? please  ;D

Well... unless it falls within your job duty ... that’s true if you have to write the initial boot code—for instance, when the hardware team shows up with a new processor with still a fresh "Engineering sample" label on it, and a new prototyping board for which not even a `crt0.s` exists yet, but it's full of debugging wiring and LA. And the processor in question might be a multi-core MIPS64 with eight superscalar cores, where concurrency integrity (using `ll/sc` instructions) relies either on a weak memory barrier tied to the cache's "dirty" attribute or on mapping accesses in "uncached kseg" mode to an external TrMem, which is "supposed to be" a better solution than the MIPS cache trick, even though it’s still experimental hardware.

In short: in a scenario like that, you’re forced to write assembly code because there’s no off-the-shelf C runtime available, and you also have to do it because it’s unclear how to handle the TrMem.

Looks like you’re in for about five months of "fun."
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Suggestions for microprocessor module
« Reply #72 on: September 23, 2026, 10:37:11 am »
Well... unless it falls within your job duty ... that’s true if you have to write the initial boot code

Everyone needs a hobby.

One of mine is try to try go go places in an airplane that they forgot to put an engine on. And sometimes even to race other people to overfly a fixed set of locations in the shortest time. Back before GPS we even had to carefully take photos of the locations in the style seen below, with your wingtip in the photo. (Here, the Hunter River entering Lake Hawea)

Not the most effective way to travel.
 
The following users thanked this post: DiTBho

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3921
  • Country: it
Re: Suggestions for microprocessor module
« Reply #73 on: September 23, 2026, 01:52:35 pm »
Any one in particular you can suggest? (For Windoze.)

https://gitextensions.github.io/

(wish i could have it on linux. Gitte looks promising as a replacement, but libadwaita. ick.)

Required: .NET 10.0 Desktop Runtime v10.0.9 x64 or later 10.x

Windows 7 supports up to .NET Framework 4.8 and modern .NET Core/.NET 6

I forgot that OP is using 7. Bah, anyway the support for NET 10 was added recently, one can always use an older version. All in the github
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5116
  • Country: gb
Re: Suggestions for microprocessor module
« Reply #74 on: September 23, 2026, 03:24:42 pm »
Everyone needs a hobby.

My hobby is to go on long road-bike rides—over 160 km—with a lightweight tent in my backpack.

That's fine, except ...

... people say the Garmin Edge 540 Solar costs too much (500-600 euros, brand new) and that the "solar charging" option isn't worth the extra money compared to the base model (+150 euros).

The truth is that I found a used one for 160 euros that needed a battery replacement, and once I swapped it out (+50 euros) and gave the glass a polish using the same products used to polish watch crystals, and ... I have to say that riding for 12 hours (4+4+4/1day) in the sun boosts the battery charge by a good 20%.

Unfortunately, I can't say that on cycling forums now, or... I'll get branded a Garmin fanboy  :-//
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->