Open source lightweight interpreter made in a day

Поділитися
Вставка
  • Опубліковано 8 чер 2024
  • Free Assembly for 1-6 Layer PCBs at JLCPCB, 3D Printing from $0.3, Sign up to Get $60 Coupons here: jlcpcb.com/?from=bitluni (Sponsor)
    I redesigned my mini game to use the new CH32X035 chip. It supports full speed USB mass storage now, got an LDR for new features and runs an interpreter that I developed on livestream. Unbelievably productive week I would say
    THE CODE: github.com/bitluni/luniASM
    Links (affiliated):
    CH32X035 dev board: aliexpress.bitluni.net/CH32X035
    CH32X035 bare ICs: aliexpress.bitluni.net/qfn035
    Tools:
    Miniware Hot Plate: aliexpress.bitluni.net/hotPlate
    Github Sponsors: github.com/sponsors/bitluni
    Patreon: / bitluni
    Channel membership: / @bitlunislab
    Paypal: paypal.me/bitluni
    0:00 Intro
    0:52 CH32X035 MCU
    1:43 Mass Storage Device
    2:04 PCB redesign & LDR
    2:52 JLC Assembly
    3:33 Case design
    3:52 3D print order
    4:04 Chip placement
    4:42 Case mistakes
    5:48 Programming the MCU
    6:21 The Plan
    6:59 luniASM
    8:32 Results
    bitluni live: / @bitlunilive
    Twitch: / bitluni
    Mastodon: chaos.social/@bitluni
    Twitter: @bitluni
    Discord: link.bitluni.net/discord
  • Наука та технологія

КОМЕНТАРІ • 133

  • @as-qh1qq
    @as-qh1qq 2 місяці тому +52

    Writing a custom ASM, its compiler _and_ its IDE - that's a Herculien effort! Incredible. Astounding.

    • @joedoe3688
      @joedoe3688 2 місяці тому +1

      sounds like Terry Davis

    • @gazehound
      @gazehound 2 місяці тому

      ​@@joedoe3688 it is much less effort than writing an OS. still impressive though

    • @BruceHoult
      @BruceHoult 2 місяці тому +2

      Assembler, not compiler .. which makes it pretty easuly, actually. I've done it a few times. It's not easy to come up with a GOOD instruction set though.

  • @zilla2257
    @zilla2257 2 місяці тому +156

    Did we really get rick rolled 12 seconds into the video? 😂

  • @Alpine_flo92002
    @Alpine_flo92002 2 місяці тому +32

    Love how QFN soldering is just SMOOSHING the part on there and it works

    • @Mr.Leeroy
      @Mr.Leeroy 2 місяці тому

      great way to create shorts

    • @LeRouxBodenstein
      @LeRouxBodenstein 2 місяці тому +4

      It is really so much easier to solder than qfp it is not even funny. With QFP if you get solder high up between two of the legs you're basically screwed. With QFN you just drag a fine tip soldering iron along the bottom edge and any excess is gone.

    • @supernovahm1178
      @supernovahm1178 2 місяці тому

      It's not, this is just how unskilled people do it.

    • @Alpine_flo92002
      @Alpine_flo92002 2 місяці тому

      @@supernovahm1178 Nope. Its how people who need it done quick do it.

    • @supernovahm1178
      @supernovahm1178 2 місяці тому

      Right, you can decscribe then as you like but this is highly unskilled and would not pass for production anywhere, and especially wouldn't pass for a warranted product.@@Alpine_flo92002

  • @himselfe
    @himselfe 2 місяці тому +46

    Forth would be perfect for this, and implementing a custom Forth isn't too complicated, though there are no doubt a few open source Forth VMs already implemented for RISC-V. Of course, doing it yourself is always the most fun. I would suggest exploring Forth, even if just for some inspiration with your own VM/language.

    • @CallousCoder
      @CallousCoder 2 місяці тому +3

      I was just writing that his language looks like a low level forth. It’s obviously a stack based engine like forth.

  • @seasong7655
    @seasong7655 2 місяці тому +11

    1:50 One trick I learned is you can invert your if statements and write the returns first, and leave out the else. This way your code won't become as deeply nested and looks better

  • @TMinusRecords
    @TMinusRecords 2 місяці тому +16

    The errors might be from windows writing to the mass storage device in an "optimized" way, it can be turned off I think

  • @sapiosuicide1552
    @sapiosuicide1552 2 місяці тому +1

    Very excited about this project!

  • @Suicid344
    @Suicid344 2 місяці тому +7

    Flashing Text on 5:51
    *Because of an oopsie

    • @BlackHeartScyther
      @BlackHeartScyther 2 місяці тому +1

      Thanks! I slowed down the video and spammed the play pause but still couldn't catch it lol

    • @Suicid344
      @Suicid344 2 місяці тому

      Same. Screen recorded it on 0.25 and then scrolled through until I got it 😅

    • @user-yj1ov9cz9g
      @user-yj1ov9cz9g 2 місяці тому

      it's a single frame at 60fps (16.67ms long)
      amazing that human eyes can read a few words at such speed (maybe after a few attempts)

  • @alexscott4277
    @alexscott4277 2 місяці тому

    Amazing work, well done!

  • @__Ben
    @__Ben 2 місяці тому +3

    I recently designed my first PCB and also used fusion to design a case, however instead of using an image of the pcb as a canvas and tracing it, I exported the PCB as a .step file from KiCad and worked around that 3d model in Fusion. Worked out well, PCB fit first try.

  • @kumanderlinux
    @kumanderlinux 2 місяці тому +1

    I hate ads but I really do like JLCPCB! Used it several times. Fast, cheap and accurate.
    Edit: Geez Louise this is advanced stuff! Very cool, new subscriber here.

  • @NicksStuff
    @NicksStuff 2 місяці тому

    This is so cool. I wish you published more videos

  • @alphaomikron2856
    @alphaomikron2856 2 місяці тому

    Wow. I've really seen a lot of stuff in the domain over the last few years - but this is next level. Best regards from Stuttgart.

  • @skmgeek
    @skmgeek 2 місяці тому +17

    Awesome video! Just one suggestion for next time, maybe don't flash text on-screen for a single frame (like at 5:51), it's only an inconvenience to people who actually want to read the text. Just a minor nitpick though :3

    • @christianlingurar7085
      @christianlingurar7085 2 місяці тому +1

      ts, pf! it's a mistake, it's the chapter headers, there's more of them, presumably on a single frame each. and then you could use the video slider, you know, "frame-by-frame" function.

    • @clonkex
      @clonkex 2 місяці тому

      ​@@christianlingurar7085 On desktop it's easy. The left and right arrow bracket keys go frame by frame. But on mobile it's virtually impossible to find a single frame like that.

    • @skmgeek
      @skmgeek 2 місяці тому +1

      ​@@christianlingurar7085if you read the text, it says "*because of an oopsie". I doubt that's a chapter header lol

  • @lemon9.9
    @lemon9.9 2 місяці тому

    The aggressive rick roll was super funny

  • @msx80
    @msx80 2 місяці тому +1

    There were some options for languages for tiny processors. One is Berry, interpreted directly on the processor, another is Millfork which is a middle level programming language that compiles to different microprocessors.

  • @CallousCoder
    @CallousCoder 2 місяці тому +1

    The assembly language looks like a low level version of forth. It’s obviously a simple stack engine. Very cool!

  • @DarrenDignam
    @DarrenDignam 2 місяці тому

    Duuuuuuuude. Every upload is a banger!

  • @herzogsbuick
    @herzogsbuick 2 місяці тому +1

    "A CASE IN FUSION" -- sounds like a prog rock concept album hehehe. ooo can jlcpcb print the liner notes?!

  • @devcybiko
    @devcybiko Місяць тому

    You beat me to it - I had also planned a MicroController Bytecode. This looks great!

  • @PaulIstoan
    @PaulIstoan 2 місяці тому

    Amazing work!

  • @AmitSharma-bm2qj
    @AmitSharma-bm2qj 2 місяці тому

    Amazing work 👍

  • @zyxwvutsrqponmlkh
    @zyxwvutsrqponmlkh 2 місяці тому

    This is good stuff man.

  • @andymouse
    @andymouse 2 місяці тому

    Jolly good show old bean.....cheers.

  • @Taras195
    @Taras195 2 місяці тому +3

    Ayyy new bitluni vid!

  • @coffeefish4743
    @coffeefish4743 2 місяці тому

    my tip for creating cassses is to also get a model of whats going to be inside the case, that way its easy to check if you forgot anything.

  • @ScienceMessiah
    @ScienceMessiah 2 місяці тому +2

    5:20
    Oh nein! ❌️
    Oh no! ❌️
    Oh nye! ✅️

  • @jessen00001
    @jessen00001 2 місяці тому

    So cool 🎉 Thanks

  • @tanzeelsalfi
    @tanzeelsalfi 2 місяці тому

    you are a genius man

  • @chexo3
    @chexo3 2 місяці тому

    Oh my god, you've tinkered with those mini black and white CRTs? I saw them a bunch a few years ago, and I was fascinated. I'll have to check out what you did with them. And maybe finally learn how to make my own electronics projects.

  • @mrksaccount123
    @mrksaccount123 2 місяці тому

    You are a genius!

  • @RicardoBHubner
    @RicardoBHubner 2 місяці тому +1

    Parabéns! tem poucos projetos sobres Lcds no youtube.
    Abraços do Brasil.

  • @LunaticCharade
    @LunaticCharade 2 місяці тому

    Very cool, and great talent. And I also wonder why? If you use a c/cpp compiler it will also run the same code on any mcu?

  • @Tomyb15
    @Tomyb15 2 місяці тому +1

    Damn, this is just pure wizardry.
    When I try writing a program for one of these somehwat obscure chips like the ones from wch or bouffalo, I get completely overwhelmed. The sdk is almost always lacking a lot of qol features with everything relying on low level api that I have no idea how they work because documentation is non existent and whatever examples there are, they are most often lacking and way too complicated despite doing something very simple. No tinyusb and certainly no arduino usb but some sort of custom library or library I've never heard of to do everything from setting up descriptors to sending and receiving data all in low level apis and from a single "example" file. Sure, I could get a blinky working, but this? I struggle understanding how you even figured a lot of the obscure parts of how to program them.
    Reaching this level of arcane magic with all those powerful spells has always been my dream. Yet the complexity never seems to end. I truly admire all the work you do.
    And btw, there is a thing called pikapython which I think can run on mcu with as little as 2KB of memory (and binary size is also small).

  • @MoesKeckeEcke
    @MoesKeckeEcke 2 місяці тому

    bitluni ? YOU ARE A SAINT!
    Thank you for sharing this information! Maybe you should offer a 1-Week "Handson" pcb design as a teacher, i would happily sacrifice 5 days of my free time and book you as a presenter/teacher?
    Just an idear if you want to kick of something more..
    Best regards ;-)

  • @chrisleech1565
    @chrisleech1565 2 місяці тому

    Like the way you oriented the LED's, envy your skill with coding. I can just manage to configure Marlin code. Please do many follow ups.

  • @AnonyDave
    @AnonyDave 2 місяці тому

    Just a fusion tip, rather than importing an image and having to draw all around the place, export a step file from kicad and so long as there are 3d models for the parts then you'll get a 3d model of your board and everything. Much easier to start with

  • @user-xk2ny1vh5h
    @user-xk2ny1vh5h 2 місяці тому

    Could you please do a series on programming. I know about functions and syntax of commands but not sure how to combine properly into a efficient workable program . Thanks

  • @TheEkskavaator
    @TheEkskavaator 2 місяці тому

    Hi! Very impressive! Where have you learned all that?

  • @D9ID9I
    @D9ID9I 2 місяці тому

    hey, how about to design stackable led panel. so you put multiple boards side to side to make larger screen. and microcontrollers for every board should sync to display one image. would be cool. like MiniLED screen

  • @misternegative2759
    @misternegative2759 2 місяці тому

    sir can u guide how to start vlsi and start building custom chips and also how to select components to design brand new board

  • @Heisenberg2097
    @Heisenberg2097 2 місяці тому

    Now to the interesting question. Do DIY tube stars like you have groupies? But where would your back stage be?

  • @adrasx6999
    @adrasx6999 8 днів тому

    if the part is 3d printed at @250°C, you can do whatever you like with a soldering iron @250°C

  • @Rtek-zv5lr
    @Rtek-zv5lr 2 місяці тому

    Interesting. Remembering that QFN involucre are not recommended for solder rework.

  • @DarkMaster0
    @DarkMaster0 2 місяці тому

    Du bist sehr klug!!!

  • @weirdboyjim
    @weirdboyjim 2 місяці тому

    I'll have to look at your bytecode and see how plausible an implementation on my system it is.

  • @thedrunknmunky6571
    @thedrunknmunky6571 2 місяці тому

    I would also love to be able to do what you do, it is very interesting to me. Where did you learn how to do this? I have an engineering background, but not in EE. This is fascinating to me.

  • @user-tw2kr6hg4r
    @user-tw2kr6hg4r 2 місяці тому

    You can use blender with the CAD drawing add-on, if you already know blender.

  • @stachelbanane2968
    @stachelbanane2968 2 місяці тому

    Jetzt fehlt nur noch ein einfacher C-Compiler der das in Dein Assembler übersetzt und das ganze wäre dann perfekt !

  • @felipemahalem
    @felipemahalem 2 місяці тому

    I also need to do a switch to a pro CAD software, been making my 3d prints in cinema4d hahah

  • @Davedarko
    @Davedarko 2 місяці тому +1

    I don't see any flexible resin options on jlcpcb, I'm confused o.O maybe it is still curing and you have to put it in the sun for some days :D

  • @mambito
    @mambito 2 місяці тому

    Awesome , 🎉

  • @PeTr01
    @PeTr01 2 місяці тому

    I saw bad apple I needed to watch this

  • @herzogsbuick
    @herzogsbuick 2 місяці тому

    oh maaaaaan the impact resistant plastic i am still laughing out loud

  • @hippie-io7225
    @hippie-io7225 2 місяці тому +5

    Congrats on the byte code work! Just make sure you don't force tabs on people like arduino did with spaces. I abandoned tabs years ago because they encouraged me to be reckless in my code writing. I started programming in 1967 using IBM punched card mainframe computers. Most of my micro controller designs in the 1990's required me to write an assembler for each new chip.
    Assembly programming has become a lost art form. Good on ya!

    • @rashidwinter
      @rashidwinter 2 місяці тому +1

      Tabs are still great, it's this modern trend on forcing multitudes of spaces that's such a pain. Programmers should be free to choose 😊

    • @hippie-io7225
      @hippie-io7225 2 місяці тому

      @@rashidwinter Exactly.

  • @uatihb
    @uatihb 2 місяці тому

    Hey, where can I see the stream where you create that asm?

  • @tiemanowo
    @tiemanowo 2 місяці тому

    8:36 why some of the "random" LEDs are slightly blinking even if they are not fully powered?

  • @BrianLough
    @BrianLough 2 місяці тому

    Power Bloughr to save the day!

  • @tortysoft
    @tortysoft 2 місяці тому

    Wow how wonderfully silly !

  • @oreste6076
    @oreste6076 2 місяці тому

    What is the "impact proof" material made from? is it 3D printed!?!?

  • @christianlingurar7085
    @christianlingurar7085 2 місяці тому

    you did WHAT? I gotta check out that assembler right away! (oh god, I am so unworthy...! ;-> )

  • @str0g
    @str0g 2 місяці тому

    Could u link the Mini hotplate that use?

  • @plutonianfairy
    @plutonianfairy 2 місяці тому

    The 🐐

  • @saatsazov
    @saatsazov 2 місяці тому +2

    Blender is nice. I'm using Fusion and want to switch to Blender

  • @jameswise9171
    @jameswise9171 2 місяці тому

    Is it possible for you to just write an LLVM target instead?

  • @iblesbosuok
    @iblesbosuok 2 місяці тому

    Remind me to mr. Tony Fourcroy, author of BUFFALO, bit user's fast friendly aid to logical operation.

  • @avramitra
    @avramitra Місяць тому

    Awesome project, man! Loved it.
    And TIL you have a live yt channel too! Smh 🤦‍♂️

  • @greenaum
    @greenaum 2 місяці тому

    Sorry, but did they ask you about the polarity of a light-dependent resistor?

  • @SianaGearz
    @SianaGearz 2 місяці тому

    A good runtime for this class of devices is Pawn scripting language.

  • @stefozkliestiny9807
    @stefozkliestiny9807 19 днів тому

    What I really with... after long time odrer my own PCb

  • @FriendlyIntentions
    @FriendlyIntentions 2 місяці тому

    We have a version with native USB firmware upload like an adruino, its janky but it works, lemme know if you want me to send it

  • @jasonpfeilsticker5692
    @jasonpfeilsticker5692 2 місяці тому

    dont have any programming pins exposed on the board... (very quick text = "*because of an oopsie")

  • @deslomeslager
    @deslomeslager 2 місяці тому

  • @WoLpH
    @WoLpH 2 місяці тому

    Wouldn't a rigid case be better here since the PCB is rigid? Otherwise the case might flex and the pcb gets damaged internally. Not sure about that, but that's my intuition

  • @AlexandruVoda
    @AlexandruVoda 2 місяці тому +2

    What's wrong with Blender?

    • @chasarr
      @chasarr 2 місяці тому +1

      It doesn't support parametric modelling, and isn't as good as CAD software for engineering tasks. With CAD, you specify dimensions, radius, bevel radius and such without bothering with vertices and the topology of the model. It's a completely different paradigm. Blender is really really good, but it just isn't made for engineering in the same way as say Fusion 360 is.

  • @Kmnri
    @Kmnri 2 місяці тому

    Here is where platformio comes in, using arduino framework without their terrible IDE and with many cores available, you can even write core/platform yourself.

  • @ameliabuns4058
    @ameliabuns4058 2 місяці тому

    20usd is a lot to money to me still tbh lol. I can’t justify the shipping so I choose standard and go insane waiting for my package for a month

  • @OmerFlame
    @OmerFlame 2 місяці тому

    Of course he played Bad Apple on it. Of course.

  • @MartinBgelund
    @MartinBgelund 2 місяці тому

    Why an LDR? Why not a phototransistor or a photodiode?

    • @BartSliggers
      @BartSliggers 2 місяці тому +1

      The characteristics of an LDR are way to slow for any communication...

  • @datswissguy5387
    @datswissguy5387 2 місяці тому

    Bitlunatic ;)

  • @csjsbsjahab
    @csjsbsjahab 2 місяці тому

    Bad appled and rickrolled wow

  • @Hukkinen
    @Hukkinen 2 місяці тому +1

    Does one get rick rolled if the resolution is too low for perceiving it, unless told or know from previous videos, that it's a rick roll 🤔

    • @tdhoward
      @tdhoward 2 місяці тому

      It's kind of like the question about the tree falling in the forest with nobody around, I think.

    • @Hukkinen
      @Hukkinen 2 місяці тому

      Exactly 😅@@tdhoward

  • @Avetho
    @Avetho 2 місяці тому

    Bad Apple ran on this? Its official then, that its capable enough to do anything we want to do now, WE CAN CREATE THE WORLD!

  • @oreste6076
    @oreste6076 2 місяці тому

    Micro: TENCENT oder 10cent (0,1 USD)

  • @jasonb4370
    @jasonb4370 2 місяці тому +1

    You are a underrated genius. You are the top 0.001% of humanity. I'm talking possibly Tesla your brain works way different than most.....

  • @PresJPolk
    @PresJPolk 2 місяці тому +3

    Fantastic video, but one small request: please stop flashing messages for such an absurdly short length of time. If you want it legible, please make it legible. If you don't want it legible, please don't put it in at all! Have a great day!

  • @Dmirty1291
    @Dmirty1291 2 місяці тому

    Управлять 240 диодами по 16 ногам! Моё почтение. 0 1 Z. Led = N*(N-1)

  • @experimentalcyborg
    @experimentalcyborg 2 місяці тому +1

    I was extremely impressed until i found out that you use tabs instead of spaces, smh /s

  • @Jackcat-ub6co
    @Jackcat-ub6co 2 місяці тому

    Great video, WHERE'S DOOM !!?!?!??!!?!??

  • @Hypoengg
    @Hypoengg 2 місяці тому

    Did i just got rick rolled.

  • @gsestream
    @gsestream 2 місяці тому

    diy circuit assembler. support for who. not you. them. and you could just do the case from sheet plastic, and bend it and melt it and make the holes. by hand.

    • @gsestream
      @gsestream 2 місяці тому

      if you want to play with fpga gpu's, you can ise a terasic DE10 nano soc platform with linux on the arm processor to test it. 110K logic units. maybe a few gpu cores like in a desktop system.

  • @Aly-the-1st
    @Aly-the-1st 2 місяці тому +1

    Please msell some

  • @2000jago
    @2000jago 2 місяці тому +1

    Definitely a bit looney!

  • @DocM221
    @DocM221 2 місяці тому

    Rick roll

  • @bxeagle3932
    @bxeagle3932 2 місяці тому

    rick roll

  • @xynonners
    @xynonners 2 місяці тому +1

    lmao bad apple

  • @lii1Il
    @lii1Il 2 місяці тому +1

    People love USB C and it can power it as well?

  • @wolpumba4099
    @wolpumba4099 2 місяці тому

    *Abstract*
    This video documents the redesign of the creator's mini game device. Key changes include the use of a CH32X035 microcontroller for native USB support (enabling mass storage functionality) and the addition of an LDR. The redesign was manufactured and assembled by JLCPCB. The device firmware was developed to support a new mass storage device feature and an interpreter for the custom-developed assembly language, luniASM. This interpreter will enable a consistent gaming experience across various device platforms.
    *Keywords:* CH32X035, mini game console, mass storage, LDR, firmware, interpreter, luniASM
    disclaimer: i used gemini on the video transcript and description

  • @anon0815de
    @anon0815de 2 місяці тому

    7:40 Unsubscribed!

    • @anon0815de
      @anon0815de 2 місяці тому

      Just kidding, amazing work!

  • @king_james_official
    @king_james_official 2 місяці тому

    you paid $30 for 10 3d prints? i know they're your sponsor, but if you don't have an SLA printer you could've just ordered something locally. i feel like calling this a no-brainer is just a blatant lie