Тёмный

RP2040 - Introduction to Assembly Language - BMA-01 

Life with David
Подписаться 9 тыс.
Просмотров 10 тыс.
50% 1

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

Наука

Опубликовано:

 

1 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 50   
@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
@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!
@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!
@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.
@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!
@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.
@zetaconvex1987
@zetaconvex1987 Год назад
Nicely done. I look forward to more vids in this series.
@LifewithDavid1
@LifewithDavid1 Год назад
Thank you. I just published one today. Enjoy!
@Aeon_Electronics
@Aeon_Electronics 7 месяцев назад
Wow, what an impressive and interesting series! Thank you!
@LifewithDavid1
@LifewithDavid1 7 месяцев назад
Thanks for the kind words. I hope RU-vid will share this with more people.
@ronaldlogan3525
@ronaldlogan3525 7 месяцев назад
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 7 месяцев назад
I really appreciate your comment. It IS good to know that we're not alone. Thanks for watching!
@OldGaul
@OldGaul Год назад
thank you for your helpful input
@LifewithDavid1
@LifewithDavid1 Год назад
You're very welcome. Thanks for watching!
@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!
@ajonescouk
@ajonescouk 7 месяцев назад
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.
@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 5 месяцев назад
Check out my bare metal interrupt video (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GyxlBpIZ28I.html) or my PIO interrupt videos (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AaxrtL4SZHQ.html) or (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-iTxJ22GZz9Y.html). Hope this helps. Good luck!
@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
@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 5 месяцев назад
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
Далее
Едим ЕДУ на ЗАПРАВКАХ 24 Часа !
28:51
Raspberry Pi Pico - Первый взгляд
8:48
Просмотров 60 тыс.
Comparing C to machine language
10:02
Просмотров 5 млн