Тёмный
Binder Tronics
Binder Tronics
Binder Tronics
Подписаться
Programming microcontrollers in the C language. Documenting what I have learned over the years in the hope that it will be useful to someone trying to learn firmware development.

Currently have a series of tutorial videos on Microchips PIC18f4520 PIC microcontrollers.
Currently in the prosses of creating a series of videos on the ATmega328P AVR microcontrollers at the register level.

List of Microcontrollers I have worked extensively on.
-PIC18f4520
-dsPIC30f2020
-ATmega328P (Register level)
-nRF52832 (SDK12.3 - SDK16)
-nRF52840 (SDK15 - SDK16)
-Arduino (Whatever you can throw at me. If it has documentation)
-ESP8266 (Arduino and RTOS SDK)
-ESP32 (Arduino and IDF)
-STM32 (STM32CubeIDE)
Комментарии
@ron030363
@ron030363 8 часов назад
You're not correlating explanation with mind and hardware to create intelligence associations. You're messing knowledge up.
@ron030363
@ron030363 8 часов назад
you're not saying why you're doing things to the source code
@user-nz1fy7dd4p
@user-nz1fy7dd4p 7 дней назад
good job u earned yourself a sub
@hyperelectron-tg5cz
@hyperelectron-tg5cz 8 дней назад
um where did you copy the oscillator frequency from in 3:36?
@BinderTronics
@BinderTronics 8 дней назад
Wrong question. How do I know what the value should be or what does the macro do are better question. Answers: It is the default chip clock. Macro is used set timing for some of the builtin functions. Explained in detail here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-E-UMOx7qv2k.html If you truly want an answers to your question, copied it from prep code.
@jhonnyebtir9016
@jhonnyebtir9016 10 дней назад
Any means of contact for services?
@BinderTronics
@BinderTronics 10 дней назад
There is an email on the channel page at more links. Next to logo. Only available on desktop.
@Captain-f2g
@Captain-f2g 13 дней назад
Thank you for the video. This very helpful for me😂😂.
@Zadar-mg2fp
@Zadar-mg2fp 14 дней назад
Pleez send me STM32F isp points
@BinderTronics
@BinderTronics 14 дней назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Lg_00KVXiwQ.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yvcAiSN7u8I.html you'll have a better time looking for SWD (serial wire debug) than for ISP.
@ruthyputhy7498
@ruthyputhy7498 17 дней назад
Great tutorial. Thank you so much!
@seifel-dinmuhammed1225
@seifel-dinmuhammed1225 18 дней назад
List of components, please!
@BinderTronics
@BinderTronics 18 дней назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-BHryCFw2U30.html ru-vid.com/group/PLtuqBdbsL-DvbB6QAGgoGBAEsGuXfGFoF
@TSA595
@TSA595 Месяц назад
baie dankie
@mosne123
@mosne123 Месяц назад
Hello Binder. I have been following ur channel for some years now and like ur comprehensive tutorials. Are there any other channels you post some material? Linkedin?
@BinderTronics
@BinderTronics Месяц назад
Nothing really. Most likely I will only duplicate what is already got on here if I decide to use another platform. Thanks sticking around for 3 years. I used to be somewhat active on twitter and patreon a few years back but it was mostly it was directing back to here. Links are in the description it you want to have a look.
@davinelulinvega
@davinelulinvega Месяц назад
Well, that is how the process of beginning in development on new platform looks like. Scrolling forums and docs is omitted.
@BinderTronics
@BinderTronics Месяц назад
Sarcasm?
@nathrm
@nathrm Месяц назад
Thank you too
@undercrackers56
@undercrackers56 Месяц назад
Thank you for sharing. What are you using to program the STM32 BluePill? I have tried ST-Link V2, ST-Link-V3 and USB ST-Link clones but nothing works. Depending upon the programmer I get error reports telling me the device (STM32) is not responding. This is a common complaint with the later issues of STM32CubeIDE. Can you please help?
@BinderTronics
@BinderTronics Месяц назад
Get an original st-link-V3 mini ~$10. I used a Segger J-link EDU, it is no longer manufactured. ST does not like people using closes with their software. If you setup a you own tool set the clones work fine. If you want to use ST tools you are going to have to use a Segger or an ordinal ST-Link. If you got a Nucleo you can hijack the ST-link from it.
@saifeldeinmohamed9315
@saifeldeinmohamed9315 Месяц назад
Why I can not find standalone project choice?
@ShyamKumar-rw2vq
@ShyamKumar-rw2vq Месяц назад
Why the ADc reading procedure is this much complex? why Cube Mx Ide not providing some simple way to read ADC channels one by one in programs .when I work with ADCs the inter channel interference is a big issue.Nobody is addressing the real problems any where. According to me the methods used By Microchip Risk Processors are very simple. The explanations about the Control register bits are confusing. Waste Of time to work with cube IDE. select channel,switch it to sample and hold,start sampling ,give result. i really dont understand why ppl are talking bla bla bla much on a simple ADC process...
@BinderTronics
@BinderTronics Месяц назад
You seem very distressed. You do not understand because you have never done serious high speed DSP. No-one uses the basic ADC on a STM but you still need to under stand it. The meat and potato's sit with DMA. Zero clock cycles wasted on operating the ADC. Set it and forget it. It will sample in the background. You only need to read the sample data out fast enough. Hands down the best ADCs I have ever used are from ST. Renasa is a close second. "select channel,switch it to sample and hold,start sampling ,give result" Exactly the same for a ST chips when using blocking samples. "Microchip Risk Processors" PIC is horrendous. "inter channel interference is a big issue. Nobody is addressing" This is a you problem. Fix your circuit. You likely have capacitive coupling caused by something external.
@ianbritt5128
@ianbritt5128 2 месяца назад
Jy moet se "shows an error" en nie "throws an error" 😂😂🤣 nie
@BinderTronics
@BinderTronics 2 месяца назад
Jy het nog nooit silent errors dan al gesien nie. As ek dit kan sien het hy dit gegooi. Toys uit die kot uit op die vloer. "Error vomit" is n ander term wat ek like.
@fifaham
@fifaham 2 месяца назад
@8:58 movlw (1<<7) | (1<<4) one line for two enables
@Prescott2400-my6di
@Prescott2400-my6di 2 месяца назад
This SoC already have a RTC, uses an Oled display to make a clock 🤨
@BinderTronics
@BinderTronics 2 месяца назад
I2C is the main focus of the video. The RTC is just something simple to interface with. A OLED can be a whole video series on its own.
@turkialamri4648
@turkialamri4648 2 месяца назад
Hey!< I'm using Atmel "ATSAM4LC2AA-AU" and I can't find standalone Project!!, help?
@BinderTronics
@BinderTronics 2 месяца назад
Cause you are using a SAM device. Last time I checked the support for Atmel chips was terrible on MPLAB. Try Microchip-studio (Atmel Studio) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-BHryCFw2U30.html
@talia37
@talia37 2 месяца назад
Hello! I'm trying your code out, and it didn't work for me. It seems like there may be a problem with the configeration settings. So, can I ask, are the configeration settings the same as what you showed in the first couple of vidoes in this series? If they are the same, do we need to make sure we set it, generate the source code (with all the #pragma lines) and then copy and paste that to the beginning of the code from github?
@BinderTronics
@BinderTronics 2 месяца назад
This is the source code github.com/Devilbinder/PIC18F_Analog_Temperature Have you been able to light up the segment display? Just display a single number nothing else. Have you been able to read the temp and nothing else? No config change, it be in the video otherwise.
@jaimeantoniohernandezfrias3665
@jaimeantoniohernandezfrias3665 3 месяца назад
Thanks for sharing your knowledge.
@heechanmoon5096
@heechanmoon5096 3 месяца назад
How can i burn the code into atmega328?
@BinderTronics
@BinderTronics 3 месяца назад
ru-vid.com/group/PLtuqBdbsL-DvbB6QAGgoGBAEsGuXfGFoF In short you will need a programmer/debugger/ICD. You can also use this code with a Arduino uno and upload via the bootloader. I only cover programming with a Pickit 4.
@suprihandoyo3900
@suprihandoyo3900 3 месяца назад
thanks
@MayukhChakraborty2512094
@MayukhChakraborty2512094 3 месяца назад
Hi. I have a question. in the video I hear you say 22 uF capacitors to be used across 16 MHz crystal oscillator but I see in the guidebook it says 22 pF. I am little confused here. Can you please clarify? Thanks again
@BinderTronics
@BinderTronics 3 месяца назад
22pF
@whenyoudiporeosinmilktheyb8329
@whenyoudiporeosinmilktheyb8329 3 месяца назад
Incredibly helpful! Thanks you so much!
@diastec2687
@diastec2687 3 месяца назад
I have a voltage inverter that uses an STM, generates a PWM signal, the chip only turns on when metal touches the GND of the STM, what could it be?
@BinderTronics
@BinderTronics 3 месяца назад
Got electronic repair experience? I wouldn't touch a inverter internals otherwise. Find a local professional to help you.
@diastec2687
@diastec2687 3 месяца назад
Sou experiente no assunto sim, me refiro no problema que esta acontecendo no oxilador pwm stm32f103c8t6, só liga se eu tocar chave ou pinça no gnd do mesmo.tenho muitos inversores com esse problema que usa essa micro.
@BinderTronics
@BinderTronics 3 месяца назад
Sounds like a floating ground. Can't help you without taking measurements myself. Google translate is not helping much for the language barrier also. Parece um terreno flutuante. Não posso ajudá-lo sem fazer as medições sozinho. O Google Tradutor também não está ajudando muito com a barreira do idioma.
@BinderTronics
@BinderTronics 3 месяца назад
Prerequisites Flash ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Y3jCXTGmWww.html Bootloader ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-vqnTSHW7beo.html USB serial ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WZHooXeoXAs.html
@WhatTheFuckII2oV3
@WhatTheFuckII2oV3 3 месяца назад
Maybe you can help me. How do you turn OFF FastPWM AFTER initializing/starting the signal? I was thinking about TIMSK1 &= ~(1 << OCIE1A); but it doesn't work
@BinderTronics
@BinderTronics 3 месяца назад
You want stop the clock of the timer to stop PWM. TCCR1B &= (0b000<< CS10);. You might need to write the pin manually to a known state. Your other option is to set the duty cycle to 0% or 100%. TIMSK1 only enables or disables the interrupts.
@BinderTronics
@BinderTronics 3 месяца назад
or change the mode of TCCR1A in the WGM1x bits
@sudheerkumar5966
@sudheerkumar5966 3 месяца назад
very very good sir. thanks
@user-sk9gr9es5d
@user-sk9gr9es5d 3 месяца назад
But how does the PIC know where there is going to be a rising/falling Edge?
@user-sk9gr9es5d
@user-sk9gr9es5d 3 месяца назад
...to further elaborate: because you have 2 Buttons that both could potentially trigger a rising/falling Edge, so now where does it say in the code that it was the Button on Pin X and not Pin Y that triggered that Edge?
@BinderTronics
@BinderTronics 3 месяца назад
K so you got two questions 1 ".. where there is going to be a rising/falling Edge" 3:30 The register is set to tell it witch edge you use. 2 "...so now where does it say in the code that it was the Button on Pin X and not Pin Y that triggered that Edge" 4:25 Testing witch flag was set
@user-sk9gr9es5d
@user-sk9gr9es5d 3 месяца назад
@@BinderTronics I found the Problem. So, I am using the PIC24FJ512GU410 and now I had somehow overseen this, but you have to use a Pin that has a INT compatibility (obviously; and that also answers the questions; because now the pic knows what Pin it has to be checking for a falling/rising Edge). But since my PIC has so many Functions the Datasheet (or where the data sheet shows what Functions what pins have) didn't show INT1/INT2 etc. so I thought I could use any PIN hence my confusion. Now when I was reading though many datasheets it turned out that I have to map INT1/INT2 etc. Functions to specific Pins because my PIC has so many Functions it didn't fit them all on every Pin. So now I have to use PPS (Peripheral Pin Select) to assign INT1 for example to Pin X and then I can turn on the rising/falling Edge and then it will hopefully work! Thanks you none the less, I love your videos
@elless317
@elless317 3 месяца назад
Hello. Thanks for video. Can you tell me the benefit of using interrupts instead of doing the same just with normal digital inputs? Thanks
@BinderTronics
@BinderTronics 3 месяца назад
Polling can miss the input and it is slower at reading the input. Interrupts are clock independent and will latch until serviced.
@elless317
@elless317 3 месяца назад
@@BinderTronics mmmh, interesting. Thanks for the reply
@abidhasanonib9032
@abidhasanonib9032 3 месяца назад
How can i program multiple servos Simultaneously No one showed this.
@BinderTronics
@BinderTronics 3 месяца назад
PWM channel per servo. This chip has 4 channels. If you need more use something like a PCA9685.
@user-fn5tt2fp8k
@user-fn5tt2fp8k 4 месяца назад
very good
@user-hz1zx9ey7d
@user-hz1zx9ey7d 4 месяца назад
EICRA |= ((0b10<<ISC10) | (0b10 <<ISC00)); is it same as EICRA |= 00001010;
@BinderTronics
@BinderTronics 4 месяца назад
less verbose
@davidhender7026
@davidhender7026 4 месяца назад
do you have a video where the screen is actually legible
@BinderTronics
@BinderTronics 4 месяца назад
what can't you see?
@BinderTronics
@BinderTronics 4 месяца назад
also what device type are you watching on? mobile, desktop or TV?
@kosei91
@kosei91 4 месяца назад
1 khoms for current limitation is a high value ? led consommation is 0.02A and voltage is 1.6 V Rled=(5V - 1.6V) / 0.02A = 170 Ohms
@BinderTronics
@BinderTronics 4 месяца назад
All we care about is, is the LED bright enough? If yes then the resistor value does not matter as long as it is within or under the current spec. Can the MCU IO drive/sink the LED at max current? Most cases not. Do we care about the efficacy? No, I would be running the LED on PWM then. Do we have a datasheet for the LED? No, best to over spec for the current then. Secondly your calculation is wrong. The current is the same through each component in a series circuit. 5V/0.02A = 250R E6 330R-470R E12 270R-470R
@kosei91
@kosei91 4 месяца назад
@@BinderTronics no calculation is good for me, you have 1.6V drop consumation by the led (Led voltage drop : 1.6V, current limitation : 0.02A) thank you for your advices, your lessons are very good
@kosei91
@kosei91 4 месяца назад
@@BinderTronics but I am agree with your advices, I'm a beginner in the world of PIC
@shahzaibshamim6524
@shahzaibshamim6524 4 месяца назад
Please start a series on nrf52. Also, which sdk is suitable because I heard that nordic is moved to nrf connect sdk so starting with soft device is suitable or not?
@BinderTronics
@BinderTronics 4 месяца назад
This is the official getting started guide: developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/installation.html They have move all their support into the Zephyr SDK. I was not a fan the last time I used it.
@kosei91
@kosei91 4 месяца назад
thank you very much for your work, every day I learnt a lot of interesting things
@xindiange
@xindiange 4 месяца назад
many thanks, could you please make a video of debugging by PICkit3?
@BinderTronics
@BinderTronics 4 месяца назад
This is with a PICkit3
@iaroslavz2644
@iaroslavz2644 4 месяца назад
Thank you very much for your great lections. It helps a lot.
@D3Labs_TheCreator
@D3Labs_TheCreator 5 месяцев назад
Can I use a 12MHz crystal oscillator instead of a 16MHz? Does that change the values of the ceramic caps?
@BinderTronics
@BinderTronics 5 месяцев назад
12Mhz is fine. you will need to re-compute any values that involve timings yourself. 22pF is a rule of thumb value. 12-22pF should work for most crystals. MCU datasheet section 9 for clocks. For loading CAPs refer to the datasheet of the crystal.
@jonathan8090
@jonathan8090 5 месяцев назад
Hello again Binder. I am following your videos and trying to replicate to learn. I have been stuck a few days without being able to power on my Led0 (13GPIO). I did everything exactly but nothing. After doing other tests, I found that putting MX_GPIO_Init(); in the main.cpp would make it work. Toggle is working fine. Do you have any clue about what I could be doing wrong? I would like to learn from this and I have exhausted my resources before asking. At least now is working!! Let me know when you can share me any tip. Thanks
@BinderTronics
@BinderTronics 5 месяцев назад
GPIOBase constructor is not running, Try running the debugger and step the code. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-vlJ_80EbMS8.html around the 8 min mark I use the debugger.
@jonathan8090
@jonathan8090 5 месяцев назад
@@BinderTronics Thanks for your reply and time. I will take my time to review it and try to debug it to find out what's happening.
@jonathan8090
@jonathan8090 5 месяцев назад
@@BinderTronics hey there! I managed to fix it. I was missing a line GPIObase::init(); in gpio_hal.cpp. I could focus on that file since the init was there so I double checked again. Now my questions are, What was the purpose of doing these files and settings with public and private. its to being able to init the Douts, keep them away from the main file and being able to call them with a short name? I am trying to understand the logic behind. Thanks!
@BinderTronics
@BinderTronics 5 месяцев назад
For files. It simply comes down to organizing code and reuse. Imagen having a book without chapters or a index. This is what will happen if you use a single files. Real projects can easily be 10k-3M lines depending on complexity. So we break the project down into files that govern a particular purpose. gpio_hal.h only governs the outputs and inputs. The name used or length has no relevants. Just name it something logical. For class access modifiers: public: anything can access it. private: only that class can access it. protected: only that class and its derived classes can access it. It is object orientated programming (OOP) theory. Covered in most courses for languages that have OOP components.
@jonathan8090
@jonathan8090 5 месяцев назад
@@BinderTronics Thanks for the explanation. Pretty much clear to me now.
@kosei91
@kosei91 5 месяцев назад
thank you very much @BinderTronics, this a wonderful job and a big chance for me to learn the ATmega328P
@Rev22-21
@Rev22-21 5 месяцев назад
RETURNING TO WINDOWS and setting this up was like pulling teeth without anesthesia. But thanks to you I have succeeded. Thank you!😊
@BinderTronics
@BinderTronics 5 месяцев назад
Try setting up a deployment pipeline for this. :)
@jonathan8090
@jonathan8090 5 месяцев назад
I really appreciate your work. I would like to study further C++. There are a lot of books right there, Could you recommend me one that you think that would be a good investment of time to learn from? (aside from this content that is really helpful). Thanks again!
@BinderTronics
@BinderTronics 5 месяцев назад
I would recommend C over C++ as a first language. I did not learn from books. What I recommend in general for whatever language is to lookup a course on RU-vid to get the fundamentals. Once you got fundamentals start your own project to solve a problem you have or something you find interesting. The is the only way you will truly learn is by doing, not by parroting tutorials. freeCodecamp.org has a metric ton of courses. w3schools is good if you want a text base course. The Cherno is pretty good for C++ as a supplement (I like the code review stuff). Fair warning, C++ can become awful real fast. GPT chat is also a fantastic learning tool to figure out how something works. It produces awful code most of the time and can't debug but it is still great if you know nothing about a topic.
@jonathan8090
@jonathan8090 5 месяцев назад
@@BinderTronics Oh that's great. Even though I'm no expert in C. I played something with PiC16 using C for embeddeds but I found out that as things get complex is a little hard to deal with, also the capabilities of the pic itself. But thank you for the tips. Even saying that helps by doing it's useful. Today I discovered that one class that I'm taking will focus in C++ for the rest of the semester and I have to code a big project. this will help me with this too . we are using Arduino Uno there. so I will play with both. Thanks mate
@BinderTronics
@BinderTronics 5 месяцев назад
Have a look at the ATmega328P series. It is the same chip as the Arduino Uno.
@jonathan8090
@jonathan8090 5 месяцев назад
Thank you! new sub. Even tho the main is cpp and the other files are c. Will it work as C++?
@BinderTronics
@BinderTronics 5 месяцев назад
C++ is for the most part "backwards" compatible with C. C structures are not 100% compatible with C++ structures. C++ treats a struct the same as a class with the default access modifier as public instead of private. You will see me use a mix of C and C++ in the later videos. C++ is not C and vise versa.
@aa7jc
@aa7jc 5 месяцев назад
Great Instructional. Good cadence and easy to follow along. Excellent!
@nileshsapkale7973
@nileshsapkale7973 5 месяцев назад
when i build that time error come, so how i track them?
@BinderTronics
@BinderTronics 5 месяцев назад
Please post the error code. I am unable to decode what you are saying.
@stanholmes4293
@stanholmes4293 5 месяцев назад
Hi What j-link programmer are you using? Where did you purchase yours?
@BinderTronics
@BinderTronics 5 месяцев назад
Got it some time back from a local retailer. If you want a J-link you will probably have to get a J-LINK EDU MINI or get a Nordic DK with a J-link OB. For ST you can get a ST-Link V3 mini and a adapter board. If you are brave you can use a FT2232 with OpenOCD. Most of these items are sold on digikey, mouser or RS. My J-Link EDU seems to be marked as obsolete. So you are going to have a hard time finding the same one as mine.