Download e-book for kindle: AVR-GCC appnotes by Leitner H.

By Leitner H.

Show description

Read Online or Download AVR-GCC appnotes PDF

Best electronics: radio books

Download e-book for kindle: ESD in Silicon Integrated Circuits by E. Ajith Amerasekera, Charvaka Duvvury

* Examines a number of the equipment to be had for circuit defense, together with insurance of the newly built ESD circuit safety schemes for VLSI circuits. * offers suggestions at the implementation of circuit defense measures. * comprises new sections on ESD layout ideas, format techniques, package deal results, and circuit innovations.

Extra info for AVR-GCC appnotes

Sample text

The individual interrupt enable control is then performed in separate control registers. Cli(): Deletes the I-bit in the status register and therefore avoids possible interrutps. enable_external_int (unsiged char ints): This function sets suitable bits in the GIMSK register (Mega series: EIMSK) in order to enable external interrupts. 3 the leds on and off. 3). Therefore an interrupt control is possible. First the bits INT0 (bit6) and INT1 (bit7) have to be set in the GIMSK register. Afterwards in the MCUCR register is adjusted to witch signal an interrupt has to be released.

When the counter value matches the content of the output compare register during counting up, PD5(OC1A) pin is cleared and if matches while counting down the PD5(OC1A) is set. When the counter value matches the content of the output compare register during counting up, PD4(OC1B) pin is set and if matches while counting down the PD4(OC1B) is cleared. h> int main( void ) { outp(0xFF, DDRD); outp(0xB3, TCCR1A); outp(0x5, TCCR1B); outp(0x00, TCNT1L); outp(0x00, TCNT1H); outp(0xFF, OCR1AL); outp(0x00, OCR1AH); outp(0xFF, OCR1BL); outp(0x00, OCR1BH); for (;;){} } /* use all pins on port D for output */ /* init the counter */ /* init the counter */ /* value of T/C1L */ /* value of T/C1L */ /* value of Compare register A Low-Byte */ /* value of Compare register A High-Byte */ /* value of Compare register B Low-Byte */ /* value of Compare register B High-Byte */ This program creates a free running PWM signal on the two outputs OCA1 and OCB1.

In this case the do-while loop is left and the content of the variable led is written on PORTB. Afterwards the variable led is increased by one and it must be prooved if led is of the value 255($FF). If this is the case led is put to 0. Otherwise one is written in position 4 of the register TIFR, which has the consequence that TOV1 bit is deleted and the timer has to begin to count once again. Interrupt mode: This mode of operation is used more frequently than polling. The TOV1 bit is not always controlled if it has been put.

Download PDF sample

AVR-GCC appnotes by Leitner H.


by Ronald
4.5

Rated 4.98 of 5 – based on 24 votes