[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

2022-06-09: Search is working again.
2022-05-12: Ghost posting is now globally disabled. 2022: Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/diy/ - Do-It-Yourself


View post   
View page     

[ Toggle deleted replies ]
File: 1.13 MB, 3840x2160, background.jpg [View same] [iqdb] [saucenao] [google]
2413542 No.2413542 [Reply] [Original] [archived.moe]

What books you suggest for learning programing micro-controllers and c++ ?

>> No.2413557
File: 17 KB, 665x111, Screenshot_2022-06-23_10-40-32.png [View same] [iqdb] [saucenao] [google]
2413557

I don't use books, but my advice is to read the data sheet, and understand how easy it is to directly manipulate registers to do what you want. Libraries are fine most of the time, but be comfortable with direct access.

Example of timer setting:

TCCR1B |= (1 << CS10); //selecting prescaler 0b001 (Tclk/1)
TCCR1B &= ~((1<<CS11) | (1<<CS12)); // turn off CS12 and CS11 bits

The names, TCCR1B and others are straight out of the avr datasheet; many arduinos use the 328p: https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

>> No.2413559

>>2413542
>micro-controllers and c++
it pains me to no end that these are somehow now compatible concepts

>> No.2413561

>>2413559
It pains me to no end that imbeciles have issues with that. Explain, if you will, how exactly that pains you, and what is the alternative in your happy world?

>> No.2413565

>>2413542
>What books you suggest for learning programing micro-controllers and c++ ?
The Protocols of the Elders of Zion

>> No.2413592

Micro controllers are like tiny computers. But an arguing and start with the learning to code meme. They all have different architectures so be prepared to read a lot of manuals.balso buy breadboard and basic electronics components

>> No.2413594

>>2413592
Buy and arduino*** fucking phone posters

>> No.2414280

>>2413561
>Explain
The resources of a microcontroller are so small in terms of time and space that the very notion of carrying OO overhead and a fucking garbage collector is mind-numblingly stupid. This doesn't even begin to explore the dangers inherent to the warped execution scheduling. "Yes yes, I know you're trying to apply the break. But listen. There's a few pages of RAM over here that really need sweeping. I'll get to it, alright? Stop screaming."
If you really want a high level language for doing low level things under crazy constraints, at least pick up Ada.

>> No.2414282

>>2414280
>break
*brake

>> No.2414287

>>2414280
C++ doesn't have a garbage collector, what are you on about?
Your complaints would be much better aimed at PicroPython.

>> No.2414297

>>2414287
>C++ doesn't have a garbage collector
Ohh, did I invent that part of C++11, which forces the allocator (again, why are you playing with memory allocation and paging at all?) to carry around hooks for GC?

>> No.2414318

>>g

Not being rude, its discussed daily there.

>> No.2414428

>>2414297
This is so unbelievably retarded and wrong I don't even know where to begin. There are microcontroller RTOSes out there right now that are written in C++.

>>
Delete posts
Password [?]Password used for file deletion.
Captcha
Action