r/microcontrollers • u/pgusto34 • Feb 07 '23
Building a Simple C++/Java Computer for a Class Project
Hi everyone,
For a class project, I want to build a simple & cheap computer with a microcontroller that would allow students to edit, compile, and display C++ or Java code. Ideally, the final product would have a keyboard and a display for coding.
I don't have a lot of microcontroller experience, so any advice on how to approach making something like this (or if it's even feasible) would be much appreciated!
Thanks!
4
u/rc3105 Feb 07 '23
Build or develop?
Develop from scratch, major PITA.
Build, using existing plans, google for instructables type projects. Plenty of 'em out there.
1
u/Hfingerman Feb 07 '23
Your best net would be a raspberry pi or similar.
The only issue is the current shortage.
1
u/overcurrent_ Feb 08 '23
for complicated programs like a compiler etc that need scheduling, memory management, accessing filesystem, concurrency, all the low level stack and libraries you generally need the abstractions and backbone of an operating system. if you dont use the most well known OS kernel, which is Linux, you will need to implement a similar kernel all by yourself; needless to say, its no ride in the park. on the other hand, such an operating system as Linux have some hardware requirements, like the presence of an MMU or memory management unit that you cannot find in an MCU. this would be the field of an MPU, or a microprocessor unit. do i have to mention that programming for an MPU in baremetal is significantly harder than simpler MCUs. now the best, sane and obvious answer is using an SBC, or single board computer, that others have done all the low level work for you; something like a raspberry pi.
1
u/hblok Feb 07 '23
Arduino, ESP32 boards and many others run C++ code. There's also some Python variants. I don't know about Java, but doesn't seems like something you'd want to run on a μC.
However, in most cases, you compile on a more powerful machine and then upload to the small board. If you want a small computer to compile and run on, that sounds more like a RPi (or one of the hundred different variations on that).
1
8
u/[deleted] Feb 07 '23
It's technically feasible but this is a huge project unless you are considering something like a Raspberry Pi as your "microcontroller." In that case you're just installing an OS and attaching keyboard and display.
To take even a 32bit MCU and develop a Java runtime or C++ compiler from scratch is not going to work for a class project, but perhaps there is a smaller scale you could attack? An MCU based text editor (essentially a typewriter or word processor) with a small LCD is probably doable.