Bare-Metal MCU #5 - AVRDude and fuses

  Рет қаралды 35,258

Mitch Davis

Mitch Davis

Күн бұрын

Пікірлер: 63
@redwoodenjoyer
@redwoodenjoyer Жыл бұрын
Seriously good series. Nobody has coherently explained anything this well, useful for all microcontrollers because you broke it into actual pieces and skipped the confusing stuff.
@FilamentFriday
@FilamentFriday Ай бұрын
4yrs ago but this was excellent.
@WaldoHazeleger
@WaldoHazeleger Жыл бұрын
I like this bare-metal series a lot. Would love to see you make an episode to replace delay() with the AVR timer.
@adaminsanoff
@adaminsanoff 3 жыл бұрын
One could not explain it better. I am an experienced hobby programmer, yet I enjoyed the series. Thank you for putting these videos together, Mitch!
@asifjc
@asifjc Жыл бұрын
I just discovered your videos and I must say that you have done a splendid job. I am starting to explore Attiny10 and would appreciate some videos on programming these small devices.
@draufunddran
@draufunddran 4 жыл бұрын
ADC and UART without libraries would be awesome... I hope I'm not too late.
@MrVouligny
@MrVouligny 3 жыл бұрын
on STM tooooo!!
@metamud8686
@metamud8686 2 жыл бұрын
5:03 actually you won't be getting an 8 MHz internal CRYSTAL oscillator, you will be getting an 8 MHz internal RC (resistor-capacitor) oscillator. No issue for what you're trying to achieve here, but there is a big difference in accuracy between an RC osc and an external, say, HC49 crystal with two 22pF caps.
@diegoamaya6353
@diegoamaya6353 4 жыл бұрын
I think compilers would be a good follow up on the series before getting into another MCU, although I would love to see some other series using an ARM microcontroller. Also seeing the programming of IO interfaces is quite interesting, Uart and maybe I2C too, thanks for the videos btw
@GrimReaperCalls
@GrimReaperCalls 4 жыл бұрын
These are getting better and better, thanks a lot for making them! I would love to compilers next.
@JBERGALIEN
@JBERGALIEN 11 ай бұрын
Hello Mitch, I found out from Atmel ATTINY85 datasheet page 148 note 2. After this fuse has been programmed device can be programmed via high-voltage serial mode, only, so the best way to alternate is to use an HV fuse setter.
@ashoksingh4879
@ashoksingh4879 2 жыл бұрын
You have huge knowledge sir. Awesome explanation. Love from India 🎉🎉
@mnavarrotube
@mnavarrotube 2 жыл бұрын
Wow, this video is at a different level. Thank you so much
@shvideo1
@shvideo1 3 жыл бұрын
What an awesome detailed and very informative video. Great information. Thank you for taking the time.
@adammontgomery7980
@adammontgomery7980 2 жыл бұрын
I did some bare metal programming a while back and used #define F_CPU 8000000UL to get timer/counters working properly without halving everything.
@formosabrowning3539
@formosabrowning3539 2 жыл бұрын
The best explanation.
@CrazyMineCuber
@CrazyMineCuber 3 жыл бұрын
Wonderful series! Please do more!
@Thiselectron21
@Thiselectron21 4 жыл бұрын
Awesome video! I would definitely be interested in learning more about cross compiling and ARM
@1fertube
@1fertube 7 ай бұрын
Excellent teaching!
@pbs570
@pbs570 Жыл бұрын
excellent, excellllllllent JOB!!!! Keep it up!
@DRI1966
@DRI1966 3 жыл бұрын
Thank You for making this video, you explain everything that I needed in a nutshell. Really well done 👍
@aashutoshswami
@aashutoshswami 8 ай бұрын
I love your videos!!!!!! They are helping me understand my engineering course much better. Thank you so much!!!! Can you make a video on ADC and UART without libraries please ?
@jonathanstodden6029
@jonathanstodden6029 4 жыл бұрын
Is there any slick was to fix the delays? Will running the microcontroller at 8 MHz instead of 16 MHz affect communication over uart? Thank you for all your great work so far. I'm really enjoying the videos.
@konaprog
@konaprog Жыл бұрын
So great! Thank you. I never would have figured out that the "Arduino as ISP" was an emulated stk500v1 and that I needed to set the baud rate. This morning I was first time able to terminal mode talk to a scrap air conditioner control that uses an atmel325v. Question though, the end of the terminal session Safemode said the lfuse, hfuse, and efuse had been changed even though I was only looking at dumps. whats that about?
@EvilSapphireR
@EvilSapphireR Жыл бұрын
At 20:29, if i understand correctly, the arduino as ISP is using the serial programming interface to write the compiled hex of the blink sketch to the flash, and NOT using the STK protocol to write the hex to the flash (which would require the programmed arduino to have a bootloader present), correct? So the stk500 naming avrdude gives to the 'arduino as ISP' is just a naming, and not the actual communication protocol being used by the programmer Arduino. Also, why is there no need of the -P flag when avrdude talking to the usbtiny programmer? Is it because avrdude talks to the usbtiny over usb port? But even when using a second arduino as isp, we connect it to the pc over usb too, so I'm not exactly sure about the difference.
@user-mr3mf8lo7y
@user-mr3mf8lo7y 2 жыл бұрын
Amazing videos. Thanks a bunch.
@martianzero2
@martianzero2 4 жыл бұрын
These are great! Just watched all 5 and really clarified a bunch of concepts I’ve been trying to wrap my head around for the last few months. I’d also had a pro micro with a bad boot loader that I couldn’t fix following some other tutorials, but with your vids I was able to fill in some gaps that I was misunderstanding. I’d like to see stuff about samd21/51 if you’re ever inclined. Thanks!
@aviv931
@aviv931 2 жыл бұрын
love your tutorials !
@JBERGALIEN
@JBERGALIEN 11 ай бұрын
Hello Mitch, and thank you for your knowledge and talent, I've just getting my feet wet about ATTiny85, and I wonder if it's better & faster to execute a line of code than having to build an HV fuse resetter , witch one is the best of the west. thank's again
@proffirmanable
@proffirmanable 3 жыл бұрын
Very inspiring and informative, thanks :)
@isaacatia-abugbilla2476
@isaacatia-abugbilla2476 3 жыл бұрын
Great video. I am really learning a lot here. Just a quick question, could we say that avrdude is thus acting like an "external bootloader" since its basically doing what the boot loader does which is essentially to to act as an intermediary between my computer and the chip/arduino itself?
@testme2026
@testme2026 4 жыл бұрын
thank you, all works you are a star mate!
@henkoegema6390
@henkoegema6390 2 жыл бұрын
Very well done. 👍 Q: I have installed avrdude via the command line in Ubuntu22.04. (no Arduino IDE). Where is avrdude.conf? (for the -C parameter)?
@henkoegema6390
@henkoegema6390 2 жыл бұрын
Yesterday I could not find it, but today I could. 🙂 It is in /etc. I really enjoy your videos.
@robinwilliams5348
@robinwilliams5348 2 жыл бұрын
This video has been SO useful, thank you so much! Is this correct please - My understanding is that I don't need to upload the bootloader to my chip at all. Using avrdude I can set the fuses and the flash the binary without putting a bootloader on there at all. Am I able to do it all in the same command or must they be done separately? I'm thinking to write the command in this order: burn the Extended, High, and Low fuses, flash the binary and then finally set the lockbits. I want to set lockbits to 0x00 (I think) such that the chip cannot be read or rewritten as much as one is able to. All it can do is execute the binary unless the entire chip is erased. Thanks again for your useful videos!!!!
@MitchDavis2
@MitchDavis2 2 жыл бұрын
It’s been a while since I made this, so take this response worth a grain of salt. You should be able to chain everything together in one command. You are correct that you don’t need a bootloader at all. Sometimes they’re nice to have, and other times it’s nice to have a little bit extra program space for your code.
@robinwilliams5348
@robinwilliams5348 2 жыл бұрын
Thank you so much for taking the time to reply. Cheers!!
@douglasthomson1989
@douglasthomson1989 2 жыл бұрын
Hi Mitch. really enjoyed this series so far and have learned alot. However, not quite sure what I've done with a couple of Arduinos nano's i seem to have bricked. They both communicated with AVRDUDE just fine when they were Arduinos and reported what they were perfectly. I've sent a little fuse (only) command to them from AVRDUDE to use the internal RC clock, and as soon as I went back to make sure they were all still good, I get the rc=-1 error, and they now won't communcate at all. It's defo not the wiring. I know I've screwed up somewhere...just not exactly sure where. Any ideas? My fault for messing with the fuses I guess. Looked so simple when you were doing it.
@MitchDavis2
@MitchDavis2 2 жыл бұрын
Are you able to reset the fuses to their defaults, or is avrdude not communicating anymore?
@leNnard_
@leNnard_ 7 ай бұрын
I ran into the same problem on my ATTINY, and figured out how to fix it consistently. If you're still looking to un-brick your NANO let me know!
@farzadbakhtiar
@farzadbakhtiar 4 жыл бұрын
Hi Mitch. Quick question. I think the answer is yes but in this video you show using your ICSP programmer while the 328p is seated in the Uno but presumably you can use the programmer with the 328p on the breadboard by wiring your programmer to the board, right?
@gyaviratuz2029
@gyaviratuz2029 2 жыл бұрын
Can we learn how to use the EEPROM programmers
@plamenpetkov7132
@plamenpetkov7132 Жыл бұрын
Тwo new ATMEGA328P (DIP28) from Ali are not seen by USBasp programmer (no response from target in SinaProg). Normal consumption (11 mA), no oscillations at 8 MHz crystal resonator, no help with external force fed clock to XTAL1 (tried 8MHz, 16 MHz). Another two in (quad flat pack in Nano) show the same no clock and no response to force fed clock. Do all 4 chips face the bin?
@reshadrei1788
@reshadrei1788 Жыл бұрын
where is the video of using UART without library
@nortronics
@nortronics 2 жыл бұрын
Ok. Forget my last comment on video 4. Now I see that bare metal
@Arceus3251
@Arceus3251 Жыл бұрын
Greets! I have to start off saying: Fantastic series thus far c: Easy for me to understand, granted I already have a background in computer science. However, I appear to have run in to a snag, unsure if anyone else had this issue. I'm attempting to write my fuses, but AVRDude fails to check the signature of my target. I get the same error in the Arduino IDE. I BELIEVE my connections are solid, sort of frustrating. ^^" Edit: Turns out my connections WERE good, it looks like the SCK pin on my target board is fried. Big sad. Gonna continue with the ATTiny85, seeing as there's a tutorial down the road for that
@evolearner
@evolearner 2 жыл бұрын
ADC and UART without libraries please! And Awesome Video Series...
@tunckuyel
@tunckuyel 4 жыл бұрын
i want to use modules without libraries. for example spi andi2c devices. but i guess before than i have to learn clock manipulations for using them or using interrupts.
@rompipelotas
@rompipelotas 2 жыл бұрын
i think if you use avrdudess..it is much simpler ..thank you for your explanations ............
@eheadj
@eheadj 4 жыл бұрын
Perfect series. Thanks for sharing. A question. Now that you are using the 8mhz internal osc, would this barebone chip be able to correctly communicate with e.g. an nrf24l01 through the RF24 library? Or like delay things would get messed up? Thank you!
@eheadj
@eheadj 4 жыл бұрын
@@MitchDavis2 Thank you so much for taking the time to do this!!! I will study your answer ASAP!
@fusca14tube
@fusca14tube 3 жыл бұрын
Hi Mitch. Awesome series! One question about security. Is there a way to protect your program against some dump technique? Maybe using this lock fuse? Can you explain it? THANKS!
@MitchDavis2
@MitchDavis2 3 жыл бұрын
I haven’t used the lock fuses myself, so I’m not exactly sure what’s possible with them. I’m fairly certain you can make your write-protect, and read-protect it. Best place to answer this would be the ATMEGA328 datasheet, and just search for LOCK. It should tel you what all the combinations do.
@fusca14tube
@fusca14tube 3 жыл бұрын
@@MitchDavis2 Thanks! I will look for it. Can I continuously set/unset/reprogram these fuses bit or it can be done only once? Can I brick the μc permanently setting up an invalid combination of these fuses?
@MitchDavis2
@MitchDavis2 3 жыл бұрын
@@fusca14tube I always thought they were permanent, but according to the datasheet (i.imgur.com/ZVxTxTn.png), it looks like they can be reset ONLY with the chip erase command. That means you can “lock” the chip, and the only way to unlock it is to erase the whole chip.
@fusca14tube
@fusca14tube 3 жыл бұрын
@@MitchDavis2 OK. Thanks for the reply.
@faxanidu3070
@faxanidu3070 4 жыл бұрын
Yay you fixed it!
@JJSogaard
@JJSogaard 2 жыл бұрын
Why didn’t I know about the programmer calculator?!? I normally use a Python shell to convert, but this is much better!
@cheapmod
@cheapmod Жыл бұрын
You start to sound like Morpheus in this series
@JohnDavidDunlap
@JohnDavidDunlap 3 жыл бұрын
ENHANCE
@chiraggoyal7637
@chiraggoyal7637 4 жыл бұрын
Nice video. I've seen all 5 videos of Arduino to STM. It'd be great if instead of teaching many controllers you move towards getting better at a single controller and lead to making projects. Thank you
@douglasthomson1989
@douglasthomson1989 2 жыл бұрын
Sorry, I mean LOW fuse...not little fuse.
Bare-Metal MCU #6: Compilers, Assemblers, and Friends
23:36
Mitch Davis
Рет қаралды 23 М.
Bare-Metal MCU #9 - Review; ATTiny85 from scratch
14:25
Mitch Davis
Рет қаралды 72 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 33 МЛН
How to Use Arduino Interrupts The Easy Way
33:28
Rachel De Barros
Рет қаралды 92 М.
Bare-Metal MCU #4 - Bootloaders and Programmers
18:24
Mitch Davis
Рет қаралды 61 М.
Optimizing Arduino Code: no setup(), no loop() ⛔
9:27
Wokwi
Рет қаралды 209 М.
Bare-Metal MCU #1 - Intro to registers
13:10
Mitch Davis
Рет қаралды 78 М.
Bare-Metal MCU #8: Optimizers and Bit-Banging
16:57
Mitch Davis
Рет қаралды 23 М.
Pin Change Interruptions ISR | PCINT | Arduino101
14:19
Electronoobs
Рет қаралды 59 М.
STM32 Guide #4: Generated Code, HAL, and Bare Metal
26:20
Mitch Davis
Рет қаралды 85 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН