Example to Blink LED on VSC

Hi, can anyone demo how to blink led using Xiao ESP32-C3 using assembly language on vsc?

Hi there,and welcome to 'our Party…
OMG Why … LOL :face_with_hand_over_mouth:
Better to do it in Arduino and use the DISassembler .a.k.a “the washing machine” LOL :grin:
takes me back, to my Z80,8086 and 68020 days. WOW
You have to make sure to use the register offsets as you can’t write to the middle… 16Bits or 32, or 64… :face_with_peeking_eye:
also for LED Espressif used on the devbrd is a RGB LED is connected through GPIO8, but it mentioned that it is addressable RGB LED . So I assume it wont work with simple GPIO output, unlike the Xiao.

I see this;

  1 .equ GPIO_OUTPUT_REG, 0x60091005
  2 .equ GPIO_SEL8, 0x60091574
  3  
  4 .section .iram_loader.text
  5 .globl call_start_cpu0
  6  
  7 call_start_cpu0:
  8  
  9     li    a0, GPIO_SEL8
 10     li    a1, 0x80
 11     sb    a1, 0(a0)
 12  
 13     li    a0, GPIO_OUTPUT_REG
 14     li    a1, 1 
 15     sb    a1, 0(a0)
 16  
 17     j halt
 18  
 19  
 20 halt: j halt
 21 
Thanks to gcantor8 :+1:

Keep in mind if you use the Washing machine , you’ll get some overhead code from the IDE…FYI
After it compiled RUN:

esptool.py --chip esp32c6 elf2image blink.elf --output blink.bin
flash it to the chip. (you may need to save it as a “.S” to flash.) ie. assembler

You’ll need to use and read the 7.5.3 section in the ESP32-C6 Technical Reference Manual.

HTH
GL :slight_smile: PJ
:v:
FYI , you may need a plugin for Visual Studio Code too.

But my lecturer banned us from using Arduino IDE :sob:

LOL… I KNEW IT WAS homework!

When I was in Engineering Fundamentals at Virginia Polytechnic Institute and State University, In 1992 I had to write a Fortran 77 program to calculate the volume in a cylendrical fuel tank laying on its side based on the stick reading of depth in inches and output of capacity in gallons… Some variables could be the radius of the tank and its length…aww the good old days… We were allowed to assume pi as =3.14… instead of calculating it to the nth decimal point…

Dam , what’s next … Punch cards… HOWLING :grin: :smiley:
Fortran 77 that was some dino days man WOW

i had to buy a book called Fortran 77… that means 1977… in 1992… talk about getting your money worth… also had to buy KeyCad… a solid modeling softwere that didnt work and we never used… just because they said we should… That thinkg took like literally 21 3.5 in floppy instalation disks… I rememder the day… when I got my student loans paid off and i threw those disks in a big green dumpster… one by one…

When we used it , the only computer was a PET , commodore and some assemble boards to a keypad.
I was 17 , Man how far it’s come, forget about the transistor density these day , WTH?
:v:

… this is how crazy i was… I had an BRAND NEW Apple II SE… everyone was going PC but i only knew Apple IIE and Commidore VIC 20 so i went the double the price option of buying an Apple with a 286 emmulator card… which also didnt work… kinda like having a negitive turbo button… but i got my friends dad from church who worked at nasa and gave me my first Apple II+ computer to buy me a 10 MEGABITE Hard Drive so i could download naked pictures of girls off this thing called a BBS… but i told him it was all for science…

1 Like

:smile: the IIE was a unicorn, they got it right with the II+ steve and woz
:v:

I think II meant you didnt have to solder it… and + meant it came in a plastic case… What Da?
E was obviously for Education Market… and Twice the price… it didnt stand for economy…