lainchan / Ω

Cheap CPUs for projects

Nobody special · 2021-01-31 14:29
The Pi Pico just came out, and I learned that there are microcontrollers that can be programmed with python. My arduino has been shelved for a bit since I don't enjoy writing C in my free time. What do you think, Lain? I've had a lot of fun blinking LEDs with my new $5 board but I'm looking for something new to do with it. Any ideas?
↑ · 2021-01-31 18:43
If you wish to discuss project ideas, that'd probably be a better fit for /Δ/ than /λ/. I'm going to kick off the thread with some /λ/ content for people like you and me who'd rather use something other than C for their embedded projects. Aside from MicroPython and CircuitPython, which come preinstalled and officially supported on plenty of boards these days, here are some amateur projects that I've found that port some higher-level language to a MCU: AVR-Ada, for 8-bit Atmel AVR: https://sourceforge.net/projects/avr-ada/ Ada For Microcontrollers, for beefier stuff like the STM32: https://github.com/rowsail/AdaForMicrocontrollers/tree/master/RTS/STM AtomVM, Erlang for the ESP32 and STM32: https://github.com/bettio/AtomVM Bitlash, a very high-level command-line interpreter with built-in concurrency for AVRs: https://bitlash.net/ Let me say that again: you can run tasks in the background and continue to have a live command line, on a 328. Microscheme, for AVRs: https://github.com/ryansuchocki/microscheme Nim for Arduino: https://github.com/zevv/nim-arduino TinyGo, for many MCUs from the ATmega328 to the ESP32 ARM Cortex: https://tinygo.org/microcontrollers/ uLisp, a new Lisp dialect for MCUs from the ATmega328 to the ESP32 and ARM Cortex: http://www.ulisp.com/show?3M ...As well as a number of Forth implementations. Most of these are very experimental, and a few are to some degree vaporware. The most mature seem to be Bitlash, uLisp and TinyGo.
Agent Smith · 2021-01-31 19:04
What happened to the last micro-controller thread? >>56810 What can those things do in terms of use cases? I understand ESP8266 and Pi Zeros and other SBCs can be used as fully fledged computers, but aren't micro-controllers like Arduinos just glorified electronic switches sans senor or relay? >>56811 >Bitlash: built-in concurrency for AVRs: Now that's just showing off! :] I'm surprised there's not more use of assembly at that level to be honest.
Liet Kynes · 2021-01-31 22:09
>>56812 As far as I know, assembly is used mostly for VERY limited microcontrollers, like PICs, which tend to have extremely limited ROM size
Drifter · 2021-02-01 19:17
>>56811 Thank you for all the resources, friend. I've been enjoying learning python the past couple months, and MicroPython seems to be ever so slightly different. Have you encountered any roadblocks? For me the only change has been using the utime library instead of time.
setq · 2021-02-02 12:11
>>56810 So, is this an AVR for people who can into Python but can't into Arduino C?
Naomi Nascimento · 2021-02-02 13:06
>>56812 >I understand ESP8266 and Pi Zeros and other SBCs can be used as fully fledged computers ESP8266 and Pi Zero are not in the same class at all. Pi zero runs full blown OS like Linux, has 512MB RAM, phone CPU, ARM ESP8266 runs jenky RTOS from ROM, 80KB RAM, very embedded focused. >but aren't micro-controllers like Arduinos just glorified electronic switches sans senor or relay? lolno >I'm surprised there's not more use of assembly at that level to be honest. Why would you when you can write C? Assembly is like kicking dead whales down the beach. I really don't get what market the pi pico is going for. I would say it's just cashing in on the pi name, but if it's really a custom chip they presumably dumped a lot of money into it. The market for hobbyist MCU boards is already so saturated and I don't see much special about this one.
pop · 2021-02-02 13:06
>>56815 No, it's ARM based.
byte · 2021-02-02 13:13
>>56817 so Arduino C in general
John Titor · 2021-02-02 13:17
>>56816 >I really don't get what market the pi pico is going for. I would say it's just cashing in on the pi name, but if it's really a custom chip they presumably dumped a lot of money into it. The market for hobbyist MCU boards is already so saturated and I don't see much special about this one. Unless there is any technological novelty in it (other than "look mom, I can program it in Python") only reason they went for it is making a statement that they are able to.
H.R. Giger · 2021-02-02 13:24
>>56815 but there's already MCU boards that can be programmed in python: teensy, bluepill, esp, etc. >>56819 >only reason they went for it is making a statement that they are able to I could actually buy that. The brits are mighty salty about their darling ARM getting sold like a cheap whore to the Japs and then sold again to NVIDIA. Might be eager to prove they can still design stuff.
hash table · 2021-02-02 13:26
>>56816 >I really don't get what market the pi pico is going for. This was my point in >>56812 Yes ESP8266 is a world apart from a Pi Zero, but both can run a web server or NAS for example, I'm not sure what the point of a Pico is?
Tomohisa "Tom" Kanezaki · 2021-02-02 14:26
They may make it matter by providing solid software stack that is optimized for their exact platform and cooperates well with their more powerful products both on software level and on electronics level (think voltages, resistance, frequencie and other stuff). Other than that it will remain a statement piece to me.
Lunch · 2021-02-02 18:15
>>56814 >I've been enjoying learning python the past couple months, and MicroPython seems to be ever so slightly different. Have you encountered any roadblocks? As the lainon you were replying to, I haven't used any of the python MCUs and so can't answer, so I release your question back to the crowd.
Liet Kynes · 2021-02-02 23:12
>>56822 >by providing solid software stack that is optimized for their exact platform If only they did that for their current products. Are they still using that janky GPU bootloader from Broadcom and building everything for the ancient least common denominator ARMv6? >voltages, resistance, frequencie It'll be 3.3v like any modern microcontroller, and the others depend on the protocol so it'll be nothing special.
x<->y · 2021-02-02 23:31
>>56824 >If only they did that for their current products. Are they still using that janky GPU bootloader from Broadcom and building everything for the ancient least common denominator ARMv6? Something akin to that as far as I remember. They are still not clever enough to figure out how to write boot loader for own product and/or signed soykafty agreement to not do so with Broadcom.
Emmanuel · 2021-11-01 21:00
I wonder how much it would take to make a little monochrome keychain console or something with it. That could be fun.
stack · 2021-11-01 21:11
>>56826 it's cheaper to just buy one thats designed for it
Bobby Newmark · 2021-12-18 09:26
Old goldie CPUs that are still used and cheap due to their simple for todays standards construction and also due to expiration of many related patents, some of them look the same as in old days, some get upgrades in technology of manufacturing and can work on higher clock speeds and/or consume less power than their grandparents while preserving backward compatibility IMHO most popular are: Zilog Z80 clones MOS 6502 clones Intel 8051 clones (you may have them controling your USB flash pendrives) Motorola 680x0 clones - clone notable nowadays is NXP Coldfire - popular in retrocomputing due to backward compatibility with older 68k CPUs and in homebrew computer projects RCA 1802 - still popular in aerospace, radiation hardened - good choice for events before nuclear winters why they matter? their original designs were created in times before putting firmware runing inside CPU was seen as a good idea, they are also cheap as fuarrrk, don't need proprietary bootloading microcodes to start working and also no backdoor firmware inside them that allows monitoring what computer is doing. Usage? Homebrew computers, controlers for drones, robots, devices, DIY audio stuff and other.
藤原純一 · 2021-12-18 12:28
>Intel 8051 I would love to have one of these. I found many good projects on https://www.projectsof8051.com/microcontroller-based-project-list/
XERXES · 2021-12-18 12:34
>>54692 https://pl.mouser.com/c/?q=8051%20microcontroller in case you wonder where you can buy them
Junichi Fujiwara · 2021-12-18 12:52
>>54693 Thanks for this. I'm sure this will help a lot man
Gyula Kovacs · 2021-12-18 15:04
Also the PIC12 clones. The Chinese love to use them. Almost as popular as 8051/8052s
Eldon Tyrell · 2021-12-18 18:53
>>54696 AH, thanks for bringing them to attention. Are other PIC family chips also still in use?
Bob Arctor · 2021-12-18 19:02
>>54696 Hmm I just took a look at PIC12 manual from Microchip and their pinout looks ummm "original" just 8 pins total - 2 of them for power and rest have many functions per pin. Designing stuff using that chip must be mindbending at least at first. Also found this homebrew project on hackaday https://hackaday.io/project/4108-pic-mcus-based-homebrew-computer Don't bother clicking that googledrive link there tho - files are gone
The Fin · 2021-12-18 23:00
Good one, i have a number of z80 running around, but never got to toying with it. Those are some of the best around and even found in calculators and gameboys i think. There was even a gnu compiler port for it made one time.
Incognito · 2021-12-19 00:23
>>54706 They have been also used in arcade cabinets (Pac Man for example) and drum machines and digitally controlled synthesizers as of popular stuff from more modern uses some now defunct company used it in their HDMI cable converters
Project 2501 · 2021-12-22 14:28
I really like the Z80 with it's dedicated IO address space, combined 8-bit registers to make 16-bit registers and compatibility with the 8080 causes it to have a lot of software available.
Neuromancer · 2021-12-23 14:01
Anyone knows which of these chips is or have clones that we can name as "lowest power consumption" among these?
Zero Cool · 2021-12-23 21:23
>>54820 You can find great ARMs and other newer RISC based chips with incredibly low power consumption. You can theoretically run newer MCUs in low power mode off AA cells for hundreds of years. That said low power design is all about trade offs. An MCU in power down mode may run for 500 years but it's of no use
Sipho Nkosi · 2021-12-24 04:10
>>54830 What is there beside ARMs? ARM chips of most manufacturers have issues with freedom if I recall correctly.
Incognito · 2021-12-24 10:44
>>54838 There's the AVR family, or you'd have to wait until RISC-V actually has some CPUs.
Cowboy · 2021-12-24 13:24
Z80 is a nice CPU. Super easy to program for and requires very little supporting hardware for a basic system. >while preserving backward compatibility I replaced a 40 year old dead z80 the other day with one bought last week. it just worked, I expected it to, but was still pleasantly surprised there were no gotchas.
Lord Nikon · 2021-12-24 14:32
>>54838 In the 8 bit market there are AVRs, PICs In 16 bit, MSP430 et al. NXP also makes some if i remember correct In 32 bit you have ARM, MIPS, POWER, and RISC-V >>54841 The are cheap RISC-V MCUs right here. Although you may have to wait until the chip shortage eases down. Can't get anything https://www.gigadevice.com/products/microcontrollers/gd32/risc-v/
Yet Another Lainon · 2021-12-25 07:40
Were microcotnrollers in mention even benchmarked against each other?
Drifter · 2022-01-11 04:32
>>54863 Why would anyone want to benchmark microcontrollers?
Ishikura "Tatsu" Tatsuhiko · 2022-01-11 08:12
>>55390 to compare power consumption for typical opeartions
Spike Spiegel · 2022-01-18 10:53
Intel8051 has multiprocessor capabilities designed in, right? https://www.brainkart.com/article/Operation-in-Multiprocessor-mode-in-8051_7912/
Emmanuel · 2022-01-22 16:28
Where can you actually buy the 1802 made by renesas? It's on their website but i have no clue on where to order it
Roger Pollack · 2022-01-22 17:02
WDC. Western Design Center is the tenains of MOS/CSG and they still make the 6592 series. Zilog still makes the Z80
Shogun · 2022-01-23 18:46
Any opinions on the Raspberry Pi's new RP2040? The chip itself costs little over a dollar, the board is $5.
Joey · 2022-01-25 04:47
>>56064 What type of opinion you need? Look up what chips it uses. Price is very reasonable
Crystepsi · 2022-02-08 13:13
Turn it into a ducky If you didnt know, it will execute keyboard commands onto whichever computer you plug it into. You can write your scripts in duckyscript. https://github.com/dbisu/pico-ducky https://www.youtube.com/watch?v=e_f9p-_JWZw Bundles of fun to be had with this one. Just be aware that your script will run as soon as you click save, so make sure to pull out on time ;)
Iverson · 2022-02-08 13:41
I swear posters these days are becoming lazier and lazier, there is already microncotrolers thread at least on >>>/Ω/
Batou · 2022-02-18 00:10
What UART chip would be easiest to pair with CMOS 6502, Zilog Z80, Motorola 68k type of CPUS? I mention 3 of them as I'm looking for versatile UART chip.
Anonymous · 2022-02-18 05:57
>>56829 This thread is about CPUs, not microcontrollers. >>57051 The 16C550 is pretty easy to use both in hardware and software.
Trinity · 2022-02-21 15:49
Are separate FPU (floating point units) chips still being made?
Incognito · 2022-02-25 14:31
>>54691 how to get started with microcontrollers? what sort of skills you need before you can start messing with microcontrollers?
Tequila · 2022-03-03 01:33
>>57294 Boolean logic Understand what condensator is for, what resistor is for and Kirhoff law, well maybe inductor too, Ohm's law have general understanding how assembly programing "works" as microcontroler is a mix of CPU and controlers - basic concepts areoun CPU and conroler sygnals general idea what PMW signal is for and what DAC and ADC conversions are (if you are interested in microcontrolers using them) a lot of patience to read official documentation of the chip from page 0 to last. Few times. Taking a notes during reading. I hate that part as it takes time but every time I skip that part I waste 4-5 times more time on a project then I normally would [I'm not kidding] Have general clue where to use it. You can do that by looking for where is such controller used both in industrial project and hobbyst "toys". Hackaday and local electronics magazines and forums etc. should be full of schematics and photos/drawings/videos of many circuits well, probly breadboard, lol, for prototyping
Marly Krushkhova · 2022-03-14 03:39
>>57065 >This thread is about CPUs, not microcontrollers. formally speaking microcontroller is a CPU plus additional parts, so not that distatnt topic
Nobody important · 2022-03-16 19:02
>>57732 I didn't say that microcontrollers don't contain processors, but saying "there already is a microcontroller thread" is false since microprocessors and microcontrollers are different and have different uses.
藤原純一 · 2022-03-17 12:14
>>57844 not entirely true
Pulse · 2022-03-17 15:36
>>57870 Mostly true is fine for my argument
Hagbard Celine · 2022-04-12 12:34
Got this whole box of 80s PC extension cards. Don't even know what system it's from. It's got those DIY looking connectors. Do you think there's something suitable for homebrew PC projects? Is there perhaps even something oft valuable that could get me some money?
Random · 2022-04-12 21:06
>>58784 Those are always worth hanging onto for cheap electronic stuff, should be easy to find out what those are too. Older chips might have some value, but unless its a collectors item i wouldnt count on it.
BloodCat · 2022-04-12 23:59
>>58784 Yea, the '80s cards are TTL chips goldmine. UART chips, RAM chips, serial, parallel controllers etc, MMU chips. You should be able to find pdf files with documentation for many chips. But make sure you are not disassembling some card that might be worth fortune on the market. If you are from germany consult computer museum in Berlin. There is also on in Poland in Wrocław.
Jean Dupont · 2022-04-13 16:29
>>58799 Thanks I'll do that. It's from 'work'. They want to salvage it for gold and I told them not to since that's probably a fraction of its real value. >>58796 Yeah. I saw some projects with the Zilog. It's impressive that this microcontroller is still in use in some devices today.
Roy Batty · 2022-04-14 07:21
Aparrently it's all custom made cards for a model railway controller. The guy did everything himself, including PCBs, which he had custom printed. He died long ago and never finished his project :(
Batou · 2022-04-14 20:54
>>58841 If you are looking for a simple PCB build - there are schemes online of like 3-5 TTL chips based computers. You pretty much can build them on 2-3 breadboards just need some additional basic components like capicitors, resistors and wires. Maybe occasionally an inductor. ou can build sets online with premade PCBS and chips that you have to solder. Depends what you are really looking for.
Armitage · 2022-04-16 19:08
>>58865 I was talking about this old guy who designed and built this by himself 40 years ago, long before the internet, before you had an abundance of shematics and information available and before chinks started making cheap ready made modules and chips which you can get for pennies. Back them it all costed money and was a real investment. You had to be really commited. It was his life project. Today you can buy ready made model railway kits which you can control with your phone and where you only have to plug the components together. I often feel a sense of helplessness with all that information overload and it prevents me to get commited to something like this man did. My interests are thinly scattered.
Joey · 2022-04-20 08:37
>>58912 Awshit I did it again
gcc -O3 · 2022-04-22 15:36
Hi lainons, I've recently bought a LG BP250 bluray/dvd player. It's pretty much a walled garden with its own UI, I don't think it can even be used as a peripheral despite the usb port (apparently it's only for reading the storage) , the only data that's libre/open source/available as source code as mentionned in the manual I can find is at https://opensource.lge.com/osSch/list?types=ALL&search=bp250 . The site has a soykafty bandwidth of barely 500kb though so it'll take a few half-dozen minutes or so if you're lucky. I might reupload the .zip somewhere for impatient people once it's done. This would probably stop there for me if that was it, however I noticed that the back of the player brags about being java-powered. I suspect this dvd/bluray "player" is larping as one and packs more of a punch than it'd like to let you think. Does any lainon here have similar experience and ever tried to bash a linux/UNIX flavor on those kind of things? Perhaps the [F]OSS docs might help, the dir is 1gb in size and is about security, maybe a pentester lainon could audit it for vulns to exploit and put a distribution on it. Perhaps some way/backdoor to unlock the bootloader and boot from the USB storage in that port? I don't have a pic of my personal one but it's a perfect match with picrel ( https://www.amazon.co.uk/LG-European-MULTIREGION-Up-scaling-External/dp/B08BVV1SLV ) . Any advice appreciated
gcc -O3 · 2022-04-22 18:06
>>59153 gcc here, I've got an update. I'm done downloading the files from the OS LG site. I was right, looks like they're using a linux kernel and a (probably GNU) toolchain in there, picrel. I was thinking I'd try to hook the thing up to a screen and plug in a keyboard into the USB port. Maybe the BIOS might recognize a keyboard's attached and let me access it; There seems to be an U-boot_2009.08 archive in /GPL2.0 , so they might be using uboot as the bootloader. I'm going to dig a little further but I'd really like some help. Also, despite all the OSS soykaf they're brandishing, I have the clinging feeling that it's not going to be easy to modify and/or redistribute their stuff... Should I move this to λ? I'm uploading the zip (or tar.gz if it's smaller and lainons are ok with it) to anonfiles or something next, I know 1GB at 500kb/s might discourage some of you/the prog lainons
Netrunner · 2022-04-22 18:22
>>59153 I can't help you with specifics. Maybe this article could be of some use. https://cromwell-intl.com/open-source/bluray.html
gcc -O3 · 2022-04-22 18:30
>>59157 > The larger document unfolds into a 60×84 cm sheet with tiny printing covering both sides. This listed the open-source software involved: Holy soykaf lainon , that's almost exactly the same setup I found on my player's source files! You're a godsend. I'll document my updates here. Here's a cool unrelated pape in the meantime.
Faye Valentine · 2022-04-22 18:39
>>59158 Maybe these forum threads could help too. LG N1T1 NAS https://forum.doozan.com/read.php?2,26671 LG N2B1 https://forum.doozan.com/read.php?2,78389 LG N2R1D https://forum.doozan.com/read.php?2,93874 Couldn't find anything about blueray players there, but people on that forum seem to have experience with this kind of thing.
gcc -O3 · 2022-04-22 18:58
>>59158 >>59157 I've found this: https://it.slashdot.org/story/15/02/28/1857211/blu-ray-players-hackable-via-malicious-discs The deadlink link was archived, thankfully: https://web.archive.org/web/20150320053905/https://www.nccgroup.com/en/blog/2015/02/abusing-blu-ray-players-pt-1-sandbox-escapes/ While the article is interesting, If we skip to Vulnerability 2, it says that >There’s already a wealth of published work on “rooting” blu-ray players, and the work by Malcom Stagg (http://www.malcolmstagg.com/bdp-s390.html) provided an initial foothold for this work. The exploit provided by that site makes use of a debug line left in the shell script meant to launch a browser, which loads any file at /mnt/sda1/bbb/libSegFault.so ; /mnt/sda1 turns out to be the usb device, so anything in the first partition on an usb named libSegFault.so in the bbb dir will just get preloaded before the browser launches. I'd have to look if this works on my player (I don't remember seeing a browser anywhere, unfortunately) and if it does I could follow the article to get root easily. >>59160 I'll check those out. I don't have loads of experience with this kind of stuff, but repurposing a dvd player into a soykafbox sounds like a sweet idea to me.
Trinity · 2022-05-08 18:51
Found this 80s book on Basic projects and thought it would be a good start to get into retro computers in combination with this project https://hackaday.io/project/19000-a-4-4ics-z80-homemade-computer-on-breadboard I also have very rudimentary proframming knowledge, so it might also be good to get some programming skillz in a playful way
Batou · 2022-05-11 11:51
You think BASIC can still be fun in 2022?
Junichi Fujiwara · 2022-05-11 18:41
>>59819 Different Lain here... you said "fun" not "useful". I taught myself Atari BASIC out of a couple of books when I was seven, after my dad and his friend showed me some uh, basics. I fell out of touch with coding as I grew older but given the effectively limitless memory available now, I would totally use that to make a Zork style game with 10,000 rooms and as many objects to pick up.
Nguoi La · 2022-05-15 10:50
>>59830 Yeah. My primary concern is fun and maybe learning a zthing or two about computers since I guess it is much more low level and the inner workings of the computer are much more accessible than on modern machines. Anyone has experience with Z80 assembly?
Ender · 2022-05-17 09:47
>>59967 I read a list of mnemonics once, does it count?
Jens Hansen · 2022-05-17 14:43
>>59967 >Anyone has experience with Z80 assembly? No, but there is a good site: http://z80.info/
Debbie Charteris · 2022-05-17 19:39
>>60009 >https://z80.info/ Thank you
Unspecified · 2022-05-18 13:53
>>60016 >>59744 Found this ebay seller who reissues old retro PCBs. He also sells a custom PCB for the Z80 computer project linked earlier. Might get that one. Will be easier than building it up on breadboard. What do you think? https://www.ebay.de/itm/194538219465 https://www.ebay.de/usr/pcb4diy?_trksid=p2060353.m1438.l2754
Unnamed · 2022-06-21 21:13
I'd suggest something like the PIC32s. Those are full MIPS microcontrollers. Also, anything from ST or TI is probably good, though I don't actually own any TI microcontrollers. SiFive also has the HiFive if you wanna use RISC-V type stuff. Advantages: RISC, Extremely powerful, could probably be a full blown computer if you tried hard enough, pretty open, etc.
Cypher · 2022-06-22 18:42
>>61050 Do they sell RISC-V done in silicon? Or they are still on the stage of preconfigured FPGA with soykafty clock speed?
Marly Krushkhova · 2022-06-22 21:14
>>59967 Z80 assembly is pretty similar to 8 or 16-bit x86 assembly, since they're both CISC and it was made to be compatible with the 8080. I would say it's relatively easy to learn, if you have any sort of experience with x86 assembly, especially compared to 6502 or 68000 assembly. The Z80 also has other cool features like loops with the DJNZ instruction and index registers which were not all that common on processors of the day.
Shogun · 2022-06-27 20:22
Is there any FLOSS circuit simulator where I can simulate own designs based on Z80 chip?
Random · 2022-07-02 11:28
>>61075 z80 also cannot into multiplying by more than 2
Liet Kynes · 2022-07-03 10:05
>>61388 You have addition and jump instructions, that's all you need.
Koichiro · 2022-07-05 01:38
I wonder why there is almost no multi CPU homebrew projects. It's not like it's a rocket science to design one after you already created at least one working singlecore CPU. Some of these old CPUs even have pins designed to work together wih other identical CPUs. Some of them even had TTL bus arbiters designed by their producers. For example 8088, 8086 as seen on list https://www.x86-guide.net/en/cmos_ttl/Intel-MCS_86.html Designing own arbiter for 2 CPUs is like 3 logic gates and a latch plus bunch of 2-1 multiplexers for memory/data/bus lines. Maybe homebrew is just such deep niche but not as deep as people designing multicpu/multicore systems. Dunno. LOL