RP2040 - Introduction to Assembly Language - BMA-01

  Рет қаралды 9,599

Life with David

Life with David

Күн бұрын

Introduction to bare metal programming -
Join David as he investigates Bare Metal Programming for a Raspberry Pi Pico. After an overview of the RP2040 processor architecture, we’ll do an introduction into ARM assembly language. Finally we’ll write our first bare metal ARM assembly language program. See the next video, Bare Metal Adventures, Chapter 2 on compiling, linking, and loading the program into the Pico.
Raspberry Pi Pico Assembly Language Tutorial #01
Bare Metal Adventures, Chapter 2, Compiling and linking assembly language programs:
• RP2040 - Compiling and...
Github files:
github.com/LifeWithDavid/Rasp...
Cortex-M0+ Generic User Guide: developer.arm.com/documentati...
ARMv6-M Architecture Reference Manual:
developer.arm.com/documentati...
RP2040 Datasheet: datasheets.raspberrypi.com/rp...
Getting Started with the Raspberry Pi Pico: datasheets.raspberrypi.com/pi...
Emulator cpulator.01xz.net/?sys=arm-de...
ARM Assembly Language Tutorial: • Assembly Language Prog...
00:00 - Introduction
00:36 - High level vs. low level programmiing
02:30 - Overview of microprocessor architecture
03:47 - RP2040 Processors
05:26 - ARM assembly instructions
06:11 - ARM assembly emulator
06:31 - Memory instructions demonstration
10:31 - Branch instructions demonstrations
12:25 - Writing our first bare metal program
14:37 - Single-cycle Input Output
15:50 - Releasing the reset register
19:56 - Enabling the GPIO
21:27 - Controlling the GPIO
22:00 - Adding a delay
23:24 - Finished program
23:50 - Closing
Music:
(Pinnacle 25 royalty-free music):
Pulsing Dance
House Fever
Reaction Time
City Night Groove

Пікірлер: 49
@supersaturn859
@supersaturn859 Жыл бұрын
I really like the comparisons drawn between your 6502 assembly experience and this... as someone who is actively developing a 6502 emulator for the Pico, it's been a wild ride to combine both worlds.
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
Sounds cool! I'm hoping to make a 6502 emulator also. I've never done one, but I have a couple ideas on how to make it fast. Not sure if it will work though. Thanks for watching!
@maximmura4234
@maximmura4234 Жыл бұрын
Out of all the electronics channels I follow you have the best "raspy old school electrician voice", the videos are a pleasure to watch and I've revisited them multiple times in my own pico projects! Love the channel, keep up the good work!
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
Wow, thanks! And thanks for watching!
@gabeb4326
@gabeb4326 4 ай бұрын
ASM more like ASMR amiriteeee
@ronaldlogan3525
@ronaldlogan3525 6 ай бұрын
I cut my teeth on 6502 single board computer SYM-1 from SynterTec , hand assemble to hex codes and poke them via the keyboard. No assembler, no compiler, just bare metal programming. This is a skill set that is now days frowned upon because nobody wants to know the machine that well. I am glad to know I am not alone, THANKS !
@LifewithDavid1
@LifewithDavid1 6 ай бұрын
I really appreciate your comment. It IS good to know that we're not alone. Thanks for watching!
@MrJackdk
@MrJackdk 7 ай бұрын
Thanks David, these video are amazing, they have helped me go from using SDK to truly using bare metal ASM.
@LifewithDavid1
@LifewithDavid1 7 ай бұрын
You're welcome. That was my goal; programming at its lowest level!
@edgeeffect
@edgeeffect 9 ай бұрын
I loved your assembly listing from 1976... by the time I got into 6502 we had a lovely assembler built in to BBC BASIC... But before then I did Z80 with good old fashioned pencil and paper. :)
@LifewithDavid1
@LifewithDavid1 9 ай бұрын
That's great! Although you can't write massive programs using paper and pencil; it still gives me satisfaction to manually work with machine code. I did write a rudimentary DOS for the 6502 using paper and pencil; but that was the limit for me.
@websanityseo
@websanityseo 8 ай бұрын
Ah, the 6502, such fond memories 🙂 I worked at IBM developing the XGA display driver Windows driver back in 1989, and we had the luxury of using the 80186; I remember a life of counting cycles and using clever tricks because every cycle you saved made the display hardware seem faster, and that's what counted in those days.
@LifewithDavid1
@LifewithDavid1 8 ай бұрын
That really brings back memories. I designed a hobbyist one-off disk operating system and had to count cycles to process the disk data in time. All in all, those early days were a lot more fun and satisfying for me than the later stuff. Thanks for watching!
@tomstewart1444
@tomstewart1444 Жыл бұрын
Hi David, Love machine code - it's so fast, precise and concise. And thanks for figuring out the fiddly details that jump-starts things for the rest of us.
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
Absolutely! Thanks for watching!
@taipo101
@taipo101 4 ай бұрын
I think there are many of us who programmed the old 8 bit cpu's. And now we have come full circle. Still same processes just more powerful cpu
@LifewithDavid1
@LifewithDavid1 4 ай бұрын
I had a blast writing a 6502 emulator for the Pico. That's in my more recent videos.
@Aeon_Electronics
@Aeon_Electronics 7 ай бұрын
Wow, what an impressive and interesting series! Thank you!
@LifewithDavid1
@LifewithDavid1 7 ай бұрын
Thanks for the kind words. I hope KZfaq will share this with more people.
@zetaconvex1987
@zetaconvex1987 Жыл бұрын
Nicely done. I look forward to more vids in this series.
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
Thank you. I just published one today. Enjoy!
@lohikarhu734
@lohikarhu734 2 ай бұрын
My first "Eureka!" came as a result of an instructor taking us on a 'working trip' through the hardware of a PDP11-05, at the TTL level, understanding that a "register" was a vrpup of D flip-flops, connected with multiplexers to an ALU, address registers/counters, memory dats bus, cchip selects...and that the 'software' was a bunch of bits in memory that controlled muxes, and register selection, and add/subtract, and...wait! 'Software....that's just hardware states controlling counters, operations, location selections...' Suddenly, as a hardware guym this "bare metal" view allowed my thoughts to work "up the stack" to "languages"!! Then, being very professional, using a POP Assembler (pencil on paper), the professionalism showed up by using lined computer paper! MC6801! First MCU with hardware muliply, in 1978..
@LifewithDavid1
@LifewithDavid1 2 ай бұрын
Thanks for the insights. Machine language really does strip back the "magic" and helps both hardware and software people get a feel for the entire computing process. Check out my emulator videos; I found the process fascinating. Thanks for watching!
@OldGaul
@OldGaul Жыл бұрын
thank you for your helpful input
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
You're very welcome. Thanks for watching!
@ajonescouk
@ajonescouk 6 ай бұрын
Im going to enjoy this series. I have a little hobby x86-64 OS and am very familiar with the architecture. Arm is completely unfamiliar to me, but I've written my OS in a "portable" way. Time to port to Arm and se how portable my design really is! Won't be doing the whole thing in assembly, but this series will be a great start for getting my asm stubs written! Thank you.
@LifewithDavid1
@LifewithDavid1 6 ай бұрын
I hope you enjoy it. The real fun begins in Chapter 4 where we dive into truly bare metal (no SDK). Thanks for watching!
@ajonescouk
@ajonescouk 6 ай бұрын
@LifewithDavid1 thanks for the reply. Looking forward to getting there with the full barebones. Not looking forward to wrestling with the linker! I have my picoprobe and breadboard at the ready. Really nice that with the picoprobe I can upload code completely hands-off and have a nice way of connecting with gdb too.
@henkoegema6390
@henkoegema6390 11 ай бұрын
Well done !! 😀
@LifewithDavid1
@LifewithDavid1 11 ай бұрын
Thank you! 😃
@caspianmaclean8122
@caspianmaclean8122 4 ай бұрын
Hi, I've been enjoying your Raspberry Pi Pico programming videos. I have a suggestion of something you could do that I'd like to see a video on: Using the MicroPython assembler for the Raspberry Pi Pico. I just made a video showing it but only with a few tiny examples. The only other videos I could find on it just showed some output, not showing the process of programming it. It seems like it could be easy to get started with since it didn't need much set up on the host computer.
@LifewithDavid1
@LifewithDavid1 4 ай бұрын
Thank you. I didn't know much about the MicroPython in-line assembler; I learned more by watching your video. I have a couple more bare metal videos I'd like to do; then I might try melding MicroPython, C/C++ and assembly all together. Thanks for the suggestion!
@JoseGustavoAbreuMurta
@JoseGustavoAbreuMurta Жыл бұрын
Excellent class on assembly language! Thanks. VS code is good IDE. My suggestion - visual studio code arm assembly
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
I've thought about using VS more; but then I get bogged down in trying to get videos out in a timely manner. I wind up sticking to what I know. Something about old dogs and new tricks. I'll look into it again. Thanks for the tip.
@MIKE-kd4sf
@MIKE-kd4sf 6 ай бұрын
I like so many others started programming on the 6502 all those years ago and took to assembler because the alternate was basic which was so so slow. P.S do I get a prize for noticing the deliberate mistake on line 25 of the blink program.............shows I was following what was going on🙂
@LifewithDavid1
@LifewithDavid1 6 ай бұрын
Ah yes; but WHICH one is wrong? They both work. That's why I didn't notice it. :-) Now I'm gravitating toward hex numbers and atomic registers so I don't get into these pickles. Thanks for the comment; and for watching! Chapters 9 and 10 feature a pico/6502 emulator; and I'm currently working on getting the 6502 TIM monitor running on the Pico.
@wktodd
@wktodd Жыл бұрын
After years of programming z80, 6502,8048,8051 and way too much pic assembler , i wonder why i'm watching this. I guess Istill find it interesting :-) . I'll (hopefully) probably never use arm assembler - well not beyond a little inline in micropython - since my brain seem to have atrophied in the last few years and even the thought of looking at opcodes gives me the shudders ;-)
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
I thought so too; but assembly works like "Prevagen" for me! I do seem to think clearer and have better memory function than before (although my head hurts just a little). lol
@user-nr9op4kv6w
@user-nr9op4kv6w 5 ай бұрын
Hello. Tell me how to make two external interrupts for counting pulses with a frequency of 1200Hz-2200Hz and a second counter 1Hz-600Hz. Thank you for your work.
@LifewithDavid1
@LifewithDavid1 4 ай бұрын
Check out my bare metal interrupt video (kzfaq.info/get/bejne/fd-on6WhrsCWaH0.html) or my PIO interrupt videos (kzfaq.info/get/bejne/d8eopdd9mbm-eIU.html) or (kzfaq.info/get/bejne/n7qofZVjrMDeaY0.html). Hope this helps. Good luck!
@turanamo
@turanamo 5 ай бұрын
21:25 str r1, [r0, #36] 36 decimal is 0x24 not 0x20. It should be #32. I tested the code with this change and it seems to work fine. Is this a mistake?
@LifewithDavid1
@LifewithDavid1 4 ай бұрын
You are right. MIKE-kd4sf pointed this out about a month ago (see previous comment). I changed the code in the Github repository. Thanks for pointing out the discrepancy.
@turanamo
@turanamo 4 ай бұрын
@@LifewithDavid1I see now. Btw, excellent presentation and teaching methods without using the pico SDK as a crutch. Maybe it would be great if you could write a book on the same, make some money 😅. I bought Stephen Smith's RP2040 ALP, but then again, the entire book uses the pico SDK as a walking stick.
@naasikhendricks1501
@naasikhendricks1501 Жыл бұрын
Hey noted you undertook rp2040 challenge
@LifewithDavid1
@LifewithDavid1 Жыл бұрын
Not sure what the RP2040 challenge is; but I've enjoyed that chip for over two years now. Thanks for watching!
@taipo101
@taipo101 4 ай бұрын
AND you are one of tge very few on here who uses flow charts Too many just dive straight in and write code with the inevitable errors. The viewer is lost and this includes one famous Harvard Pico course.
@LifewithDavid1
@LifewithDavid1 4 ай бұрын
Thanks. When I wrote the emulator; I filled an entire yellow pad with flow charts. I just can't think without pencil and paper. BTW, "The Prisoner" takes me back to those wonderful shows of the late sixties (including "The Avengers"). They don't make them like that anymore.
@user-sr4ev9ij8q
@user-sr4ev9ij8q 2 ай бұрын
Who invented this term "bare metal"❓I found it's the humiliation of Semi Conductor 😂
@LifewithDavid1
@LifewithDavid1 2 ай бұрын
I guess Captain Pico is going "commando'. LOL
RP2040 - Compiling and Linking Assembly Programs - BMA-02
8:56
Life with David
Рет қаралды 3,2 М.
Raspberry Pi Pico - Первый взгляд
8:48
arduinoLab
Рет қаралды 60 М.
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 80 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 11 МЛН
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Паша Осадчий
Рет қаралды 8 МЛН
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 18 МЛН
you can learn assembly FAST with this technique (arm64 breakdown)
12:37
Low Level Learning
Рет қаралды 150 М.
Turning a Raspberry Pi Pico into a GPU!
16:42
element14 presents
Рет қаралды 103 М.
The new Raspberry Pi Pico W is just $6
7:56
Jeff Geerling
Рет қаралды 430 М.
Comparing C to machine language
10:02
Ben Eater
Рет қаралды 5 МЛН
Assembly Language in 100 Seconds
2:44
Fireship
Рет қаралды 1,5 МЛН
What is VGA and How to Use it With a Raspberry Pi Pico
18:28
Gary Explains
Рет қаралды 51 М.
Making an OS (x86) Chapter 1 - CPU, Assembly, Booting
6:56
Daedalus Community
Рет қаралды 449 М.
rust runs on EVERYTHING (no operating system, just Rust)
18:10
Low Level Learning
Рет қаралды 348 М.
Что не так с LG? #lg
0:54
Не шарю!
Рет қаралды 23 М.
Телефон в воде 🤯
0:28
FATA MORGANA
Рет қаралды 1,2 МЛН
#miniphone
0:16
Miniphone
Рет қаралды 3,6 МЛН