[ 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

Search:


View post   

>> No.2413557 [View]
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

Navigation
View posts[+24][+48][+96]