[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself


View post   

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

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++.

>> No.2415005
File: 3.40 MB, 1835x3260, IMG_20220625_134117_edit_3835411640559.jpg [View same] [iqdb] [saucenao] [google]
2415005

>>2413542
Pic related

>> No.2415160

>>2415005
Did you actually read all that? I find that textbooks like that are so long and difficult that I end up only looking up the things I need and skipping the rest

>> No.2415278

RTOS is annoying as fuck but you need it if you want efficient multitasking programs. Stuff like Arduino IDE has polling issues, and no proper sleep function (instead of turning off for a set amount of time it will just burn cycles).
If you don’t know how to program try to learn that first. Once you memorize all the patterns of C++ or java or python or whatever you can move on.
I would recommend a big textbook and the arduino datasheet, but also give yourself projects to do. The best way to learn something is alternate between study and applying everyday.

>> No.2415333

>>2413565
That's just to learn c++, for microcontrollers I recommend you The culture of critique

>> No.2415606

>>2414428
>There are microcontroller RTOSes out there right now that are written in C++.
There are also thermostats which query webservers across the Internet to function.
And you seem to be pumping air.
Both proof that mere existence is insufficient to assert intelligence.

>> No.2415824

>>2415160
Yes I read it. And I disrespect people who want to know something but don't have the attention span to look at some words for longer than a TikTok video.

>> No.2416536

>>2413542
Get a pic 16/24 and a bootleg copy of Proteus.

Make a simple counter, a/d converter, and if do.

>> No.2417130

>>2415824
why old farts can't write books in a concise and short manner

>> No.2417428

>>2417130
Why zoomers don't have attention-span greater than 2 minutes?
I wish you'd be time warped into the 1800's and live a life in poverty on the streets because you can't be bothered to read more than 2 pages.

>> No.2417763

>>2417428
nigger

>> No.2417768

>>2417428
zoomers have to worry about their futures and every lost minute is a threat to their survival because boomers stole all their resources and then bred them into poverty
boomers don't have to worry about their futures and can waste time on writing and reading endless paragraphs that never get to the point

>> No.2417917

>>2413559
They really aren't...university freshers will just regurgitate their no nothing professors (some of which even advocate Rust now...lmao I know). Then as the years go by, they complain there is limited support for C++, not understanding why any silicon vendors could not possibly be arsed to write compilers for it.

>> No.2418023

>>2414280
You are actually braindead. This is the perfect example of Dunning-Kruger. First, C++ doesn't have a garbage collector. Low-level memory management is handled as you chose to handle it. Second, a garbage collector would use more resources on an embedded system as opposed to strict memory management. Third, you mean LOW level language. Now how about you stop fucking talking out of your ass because you have no concept of anything you are saying.

>> No.2418088
File: 311 KB, 1500x1407, oMpMlNbNmQSFtZOofDwBCwJr6y4ORivRqk3qD9I792Y.jpg [View same] [iqdb] [saucenao] [google]
2418088

>>2417763
>Educated and book-reading people are the real niggers
t. Pic related