-
Datei
colorlcd.bas
fuse bytes. '--------------------- Dim I As Byte , J As Byte , N As Byte , Rcc As Byte Lcd_a0 Alias Portc.5 Lcd_cs Alias Portc.7 Lcd_reset Alias Portc.6 Lcd_wr Alias Portc.4 Lcd_data Alias Porta Config Lcd_data = Output Config Lcd_a0 = Output Config Lcd_cs = Output Config Lcd_reset = Output Config Lcd_wr
in „Mini-Farbdisplay (+mehr) für 1 Euro“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
colorlcd.bas
fuse bytes. '--------------------- Dim I As Byte , J As Byte , N As Byte , Rcc As Byte Lcd_a0 Alias Portc.5 Lcd_cs Alias Portc.7 Lcd_reset Alias Portc.6 Lcd_wr Alias Portc.4 Lcd_data Alias Porta Config Lcd_data = Output Config Lcd_a0 = Output Config Lcd_cs = Output Config Lcd_reset = Output Config Lcd_wr
in „Mini-Farbdisplay (+mehr) für 1 Euro“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
3310LCD.c
100); SET_RST_PIN; SET_SCE_PIN; //disable LCD LCD_writeCommand( 0x21 ); // LCD Extended Commands. PORTC = 0b00000001; LCD_writeCommand( 0xE0 ); // Set LCD Vop (Contrast). PORTC = 0b00000011; //LCD_writeCommand1( 0x90 ); //von mir //LCD_writeCommand( 0x07 ); //von mir //LCD_writeCommand( 0x13 ); //von
in „Ladegerät für NiMH Akku mit 3310 display“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
fahrwerk.c
über beide Maschinen { if ((volt_machine[x] <= 488) && (control > 0)) // Geradeaus --> 0 bis 2,38V { PORTC = 1; offset[x] = setpoint - volt_machine[x]; // Regeldifferenz berechnen if (offset[x] < 0) // Wenn e negativ { offset[x] = (offset[x] & 0x7fff); // Vorzeichen eliminieren offset[x] = (offset[x] >>
in „mmh wer findet den Fehler?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
gamecubelicht.c
PORTD #define RLED4_PORTPIN PD4 //Blaue LEDs //Blaue LED 1 #define BLED1_DDR DDRC #define BLED1_PORT PORTC #define BLED1_PORTPIN PC1 //Blaue LED 2 #define BLED2_DDR DDRC #define BLED2_PORT PORTC #define BLED2_PORTPIN PC2 //Blaue LED 3 #define BLED3_DDR DDRC #define BLED3_PORT PORTC #define BLED3_PORTPIN PC3 //Blaue LED 4 #define BLED4_DDR DDRC #define BLED4_PORT PORTC #define BLED4_PORTPIN PC4 #define BLED1_ON ( BLED1_PORT |= (1<<BLED1_PORTPIN) ) #define BLED1_OFF ( BLED1_PORT &= ~(1<<BLED1_PORTPIN) ) #define BLED2_ON ( BLED2_PORT |= (1<<BLED2_PORTPIN) ) #define
in „LED Lightshow mit verschiedenen Programmen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
platform.c
CONFIG_BOARD_LED_XFER BOARD_LED1_ID #endif void uart_init (void) { // Set the TxD pin high - set PORTC DIR register bit 3 to 1 PORTC.OUTSET = PIN3_bm; // Set the TxD pin as an output - set PORTC OUT register bit 3 to 1 PORTC.DIRSET = PIN3_bm; // Set baud rate & frame format USARTC0.BAUDCTRLB = 0; //
in „XPLAIN mit Atxmega128a1 - Problem mit C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
vu.asm
portd, LEDB mov T2L, VU1 ;Wurzel als Pseudo Logarithmus mov T2H, VU2 rcall sqrt16 mov temp, AL outi portc, 0 ;VUA aus outi portb, 0 ;VUB aus in AL, portd andi AL, 15 ori AL, 240 out portd, AL mov T2L, VUB1 mov T2H, VUB2 rcall sqrt16 mov temp2, AL inc Ledmux ;Der weitere Code ist die LED Ansteuerung, cpi
-
Datei
psensor.bas
16000000 $baud = 115200 $hwstack = 64 $swstack = 64 $framesize = 64 $lib "i2c_twi.lbx" 'I2C Config Sda = Portc.1 Config Scl = Portc.0 Config Twi = 100000 Config Portb.3 = Output 'MCLK Config Portc.2 = Output 'XCLR Mclk Alias Portb.3 Xclr Alias Portc.2 Config Timer0 = Timer , Prescale = 1 'Timer0 for MCLK signal
in „Drucksensor HP03 und Bascom-AVR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
solar.c
static unsigned char pos=0; /*Variable zur Bestimmung der aktuellen Display Funktion*/ icount++; PORTC=0; PORTD=pgm_read_byte(&show[display[pos]]); PORTC|=(1<<pos); if(pos==0&&einspeisen==1) /*Punkt ob eingespeist wird oder nicht*/ PORTD&=~(1<<7); if(pos==1&&powered==1) /*Punkt ob WP gepowered oder
in „Display fällt in unregelmäßigen Abständen aus“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
Output for Timer0 DDRB |= _BV(PINB3); // Now enable global interrupts sei(); // Pin A0-A7 are on PORTC. // Pins D8-D13 are on PORTB. // Pins D0-D7 on PORTD. PORTC |= numbitmaska; // Set all pins A0-A5 HIGH DDRC |= numbitmaska; // Set all Pins A0-A5 as OUTPUT PORTD |= ((digbitmask) | (numbitmaskd));
in „Seminarprojekt Binäruhr, passenden µC gesucht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
vu.asm
portd, LEDB mov T2L, VU1 ;Wurzel als Pseudo Logarithmus mov T2H, VU2 rcall sqrt16 mov temp, AL outi portc, 0 ;VUA aus outi portb, 0 ;VUB aus in AL, portd andi AL, 15 ori AL, 240 out portd, AL mov T2L, VUB1 mov T2H, VUB2 rcall sqrt16 mov temp2, AL inc Ledmux ;Der weitere Code ist die LED Ansteuerung, cpi
in „Schnelle FFT in Assembler“ · Digitale Signalverarbeitung / DSP / Machine Learning ·
-
Datei
main.c
&=~(1<<REED_0); //Reed 0 DDRD &=~(1<<RFM_IRQ); //IRQ_IN //interne Pull-Up-Widerstände einschalten PORTC |= (1<<DIP1); //DIP-Schalter PORTC |= (1<<DIP2); //DIP-Schalter PORTC |= (1<<DIP3); //DIP-Schalter PORTC |= (1<<DIP4); //DIP-Schalter PORTD |= (1<<REED_0); //Reed-Kontakt //PORTD |= (1<<RFM_IRQ); /
in „Attiny13 spring t aus Hauptschleife“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Stromregelung.c
*********SOFTWARE Interrupts****************/ ISR (TIMER1_COMPA_vect) //Zündung erste Halbwelle { PORTC &= ~(1<<PC0); //T1 AN W1 Low Aktiv } ISR (TIMER1_COMPB_vect) //Löschen aller gezündeten Pins { PORTC |= (1<<PC0); //T1 aus W1 Low Aktiv } ISR (TIMER3_COMPA_vect) //Zündung löschen zweite Halbwelle { PORTC &=~ (1<<PC0); //T1 an W1 Low Aktiv } ISR (TIMER3_COMPB_vect) //Zündung löschen zweite Halbwelle { PORTC |= (1<<PC0); //T1 aus W1 Low Aktiv } /* ISR (TIMER5_COMPA_vect) { if(foo=1) { PORTA &=~(1<<PINA0
in „Software architektur, wo plaziere ich meine funktion“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.c
diese Definition einen Low Pegel = LED wäre an. outp (0x00,DDRC); // Port c als Eingang outp (0xff,PORTC); // Pull-Up auf Port C, Pin 4+5 aktivieren an den beiden Pins werden nun interne Pullups gesetzt.Man kann aber auch FF schreiben. for (;;) { if (bit_is_clear (PINC,5)) //PIN 5 PortC abfragen Taster
in „Probleme mit AVR Studio“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
iButton_DS1923.bas
Lcd_db4 Alias Portb.4 Lcd_db5 Alias Portb.5 Lcd_db6 Alias Portb.6 Lcd_db7 Alias Portb.7 Lcd_e Alias Portc.1 Lcd_rs Alias Portc.2 Config Lcdpin = Pin , Db4 = Lcd_db4 , Db5 = Lcd_db5 , Db6 = Lcd_db6 , Db7 = Lcd_db7 , Rs = Lcd_rs , E = Lcd_e Config Lcd = 20 * 4 Cursor Off Cls '----------------------------
in „Temperatur & Feuchte Sensor DS1923-F5“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
0xFF, DDRC); //als ausgang outp (0xFF, DDRB); //als ausgang outp (0xFF, DDRD); //als ausgang outp(0, PORTC); cbi(PORTB,load); cbi(PORTB,cp); cbi(PORTB,frame); for(;;) { for (y=0; y<199; y++) { if (y<=1) sbi(PORTB,frame); for (x=0; x<60; x++) { zxl=255; zxh=255; if (x==28 && y>=zy && y<zy+hoehe) //J { zxl
in „Pollin Display Optrex F-51154NF-FW-AA“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
heizung.c
RW PD6 void lcd_cmd(unsigned char cmd, unsigned char cntr) { PORTD &= ~(1<<A0); PORTD &= ~(1<<RW); PORTC = cmd; PORTD |= (1<<E1); _delay_ms(1); PORTD &= ~(1<<E1); _delay_ms(1); } void lcd_data(unsigned char data, unsigned char cntr) { PORTD |= (1<<A0); PORTD &= ~(1<<RW); PORTC = data; PORTD |= (1<<E1)
in „Grafik-Display an AVR - Probleme“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
( char c, char d, int long counterMax ) { int long counter = 0; while ( counter < counterMax ) { PORTC = 0x00; PORTD = 0x00; wait( pause ); PORTC = c; PORTD = d; wait( 1 ); counter++; } } int main (void) { char starsOn[2][cycles] = { { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05
in „AVR unverständliche for Schleife“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DisplayAtmega8.c
#define F_CPU 8000000UL #include <avr/io.h> #include <util/delay.h> #define LCD_DATA PORTC #define LCD_DATADDR DDRC #define LCD_Control PORTD #define LCD_ControlDDR DDRD #define _RS 0x01 #define _RW 0x02 #define _Enable 0x04 int main (void){ DDRB = 0x02; LCD_DATADDR = 0xFF; // LCD_DATA als
in „Atmega8 LCD Fehler im Programm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spi.c
enable } int main(void) { spi_sklave_init(); //init hardware DDRC |= 0xFF; //8Bit SPI-dataframe on PORTC PORTC = 0x55; //validation sei(); //enable global interrupt while(1); return(0); } //SPI transfer complete ISR(SPI_STC_vect) { uint8_t tmp_sreg = SREG; //backup SREG with actual sei() cli(); //diable global interrupt PORTC = SPDR; //calculate Rs SREG = tmp_sreg; //restore SREG } //=========================================================================== // End of SourceCode. //======================================
in „SPI AT128 <-> AT32“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
08_wie_testprog.c
unsigned) &y*8+z) //Eingänge PIN (/*Switch*/Pir, PORTB, 4); //PIN (Pir, PORTB, 5); //Ausgänge PIN (Out, PORTC, 1);//PWM Ausgang PIN (Laut, PORTC, 0); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// fPortinitialisierung(void) { ANSEL = 0x00; /*PORTA
in „PIC ignoriert endlosschleife“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RxAntenna.c
void Transmit(unsigned char c) { while( !(UCSR0A & (1<<UDRE0) ) ); UDR0=c; } void set_Debug_LED() { PORTC |= (1<<PC0); } void reset_Debug_LED() { PORTC &= ~(1<<PC0); } void send_debug_msg(char *str) { Transmit(*str); while( *(++str)!=0) Transmit(*str); } void check_valid_payload() { if(data==RX_ADDR) {
in „Probleme beim Steuerung per Funk- ATmega328p und RX315, TX315 set“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RxAntenna.c
void Transmit(unsigned char c) { while( !(UCSR0A & (1<<UDRE0) ) ); UDR0=c; } void set_Debug_LED() { PORTC |= (1<<PC0); } void reset_Debug_LED() { PORTC &= ~(1<<PC0); } void send_debug_msg(char *str) { Transmit(*str); while( *(++str)!=0) Transmit(*str); } void check_valid_payload() { if(data==RX_ADDR) {
in „Probleme beim Steuerung per Funk- ATmega328p und RX315, TX315 set“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
fotoled.c
wird Ergebnis der nächsten Wandlung nicht übernommen. */ (void) ADCW; } uint16_t getLight(void) { PORTC &= ~(1<<LED); //LED ausschalten _delay_ms(5); DDRC &= ~(1<<LED); // LED-Port als Eingang _delay_ms(5); ADCSRA |= (1<<ADSC); while (ADCSRA & (1 << ADSC)) { } DDRC |= (1 << LED); // LED-Port als Ausgang
in „LED zur Helligkeitsmessung - ADC Spannungsmessung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
be the start of the next message startframe = 1; } int main(void) { // init LED DDRC = 0b00100000; PORTC = 0b00100000; uart_init(); timer_init(); sei(); while(1) { // debug output while(!(UCSRA & (1<<UDRE))); UDR = lanc[4]; // Rec? if(lanc[4] == 0xEB) PORTC &= ~(1<<PC5); // Stop? else //if(lanc[4] == 0x02) PORTC |= (1<<PC5); } return 0; }
in „LANC Implementierung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TimerTest.cpp
OVF_vect) { Porta::Toggle(0xFF); } ISR(TIMER0_COMPA_vect){ Portb::Toggle(0xFF); } ISR(TIMER1_OVF_vect) { Portc::Toggle(0xFF); } ISR(TIMER2_OVF_vect) { Portd::Toggle(0xFF); } int main() { //***************************************************************************** Porta::SetConfiguration(0xff, Porta::Out); //-> DDRA = 0xff; Portb::SetConfiguration(0xff, Portb::Out); //-> DDRB = 0xff; Portc::SetConfiguration(0xff, Portc::Out); //-> DDRC = 0xff; Portd::SetConfiguration(0xff, Portd::Out); //-> DDRD = 0xff; //*************************************************************************** //Timer0
in „statische Memberfunktion als Interrupt-Handler?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
gamer.txt
PORTB cbr TEMP,2 out PORTB,TEMP in TEMP,DDRC ; deglitch not needed cbr TEMP,1 out DDRC,TEMP in TEMP,PORTC cbr TEMP,1 out PORTC,TEMP ldi r27,0 ldi r31,3 TL: ; cycl. ld r0,z ; 2 out PORTD,r0 ; 1 update BIT 0..7 sub r28,r24 ; 1 sbc r29,r25 ; 1 sbc r30,r26 ; 1 sbc r31,r27 ; 1 ori r31,0x02 ; 1 limit to 1.5
in „DDS normal ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
4x3_Relaise.bas
* Config Debounce = 150 ' Defaultwert erweitern Config Porta = Input Config Portb = Output Config Portc = Output Ddrd = &H0F 'PD7-PD4 Input; PD3-PD0 output Portd = &HFF 'mit intern. pullup Dim Column As Byte Dim Row As Byte Dim Key As Byte 'Variable mit Key-Nr Portc = 0 'alles Relais aus Do For Column
-
Datei
FP500b.asm
,0b11111111 out DDRA,temp sbi DDRC,0 sbi DDRC,1 sbi DDRC,2 ldi temp,0b00000000 out PORTA,temp cbi PORTC,0 cbi PORTC,1 cbi PORTC,2 ; ; ;Init Timer 0 für Multiplex ; ldi temp,0 out TCCR0A,temp out TIFR0,temp ldi temp,0b00000101 ;Vorteiler 1024 out TCCR0B,temp ldi temp,0b00000001 ;Timer 0 überlauf ;out
in „ATmega 2561 Timerproblem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Werkzuegwechsler_neu.c
Springe in die Schleife wen Z Achse auf 1/10 SPS = 1 und Freigabesignal = 1 { j=0; //Setze j auf 0 PORTC |= (1<<PC0); //Setze Z Achse Richtung auf 1 for(j=0; j>80; j++) //Zähle bis 80(Pulse) dan Spring aus der Schleife raus { PORTC |= (1<<PC1); //Setze Z Achse Puls = 1 warte (5000); //Einstellen der Zeit der Positiven Halbwelle PORTC &= ~(1<<PC1); //Setze Z Achse Puls = 0 warte (5000); //Einstellen der Zeit der Negativen Halbwelle } if(j==80) //Nach den 80 Pulsen springe in diese Schleife { PORTD |= (1<<PD0); //Setze Z Achse auf
in „Bräuchte hilfe bei der Programmierung eines Atmega 32“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
( char c, char d, int long counterMax ) { int long counter = 0; while ( counter < counterMax ) { PORTC = 0x00; PORTD = 0x00; wait( pause ); PORTC = c; PORTD = d; wait( 1 ); counter++; } } int main (void) { int j; DDRB = 0x01; // debug LED on board DDRC= 0x0f; DDRD = 0xff; PORTB = 0x01; // debug LED
in „AVR unverständliche for Schleife“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.asm
30.12.06 AK v2.1 x Umwandlung binär - ASCII ;* ;* 30.12.06 AK v2.2 x Umstellung des LCD von PORTD auf PORTC ;* ;* 09.01.06 AK v2.3 x INT0 + Counter (erster Versuch) ;* ;**************************************************************************** .include "m16def.inc" ;Register .def temp = r16 .def temp1
in „Problem: RESET wenn AVR bis 203 gezählt hat???“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Backup_mit_int_rb_.c
11, 7 to 12 #byte PORTA = 0xf80 // adresse du PORTx #byte PORTB = 0xf81 // adresse du PORTx #byte PORTC = 0xf82 // adresse du PORTx #byte PORTD = 0xf83 // adresse du PORTx #byte PORTE = 0xf84 // adresse du PORTx #bit SCL = PORTB.1 #bit SDA = PORTB.0 #bit STOP = PORTC.1 #bit START = PORTC.2 //--------
in „USB-CDC mit externen Interrupt1“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Taster1.txt
, r16 ldi r16, 0b00000011 ;Port C 0-1 mit Pullup + Ausgänge 2-7 auf 0 setzen (Initialzustand) out PORTC, r16 ldi r16, 0b00000000 ;Port D komplett als Eingang out DDRD, r16 ldi r16, 0b11111110 ;Port D alle Pins mit Pullup out PORTD, r16 ldi r17, (1<<PCINT24) ;Auswahl des entsprechenden Pins, hier PORTD
in „PinChange-Problem!“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.h
<< PB3)) #define Taster_5 (PINB & (1 << PB4)) #define Taster_6 (PINC & (1 << PC7)) #define HGBein PORTC |= (1 << PC6) #define HGBaus PORTC &= ~(1 << PC6) #define HGBtoggle PORTC ^= (1 << PC6) #define Transistor1_ein PORTD |= (1 << PD0) #define Transistor1_aus PORTD &= ~(1 << PD0) #define Transistor1_
in „Problem mit ATmega32“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
DS18B20_readme.pdf
unterschiedliche Pins zugreifen können. Im Beispielcode benutze ich an einem ATmegax8 6 Pins des PORTC, um bis zu 6 Sensoren anzusprechen. (An PORTB hat man 8 Pins frei, aber hier ist auch der Programmieradapter angeschlossen). In der Header-Datei muss zuerst vereinbart werden, über welchen Port und
in „Vereinfachte Methode zur Temperaturmessung mit mehreren DS18B20 in C“ · Projekte & Code ·
-
Datei
dotmatrix.bas
Sub Reset_(x As Byte , Byval Index As Byte) Config Porta = Output ' all rows Hi Porta = &HFF Config Portc = Output ' all columns Lo Portc = 0 Restore Dotmatrix For I = 0 To 7 Read X Shift X , Left , 3 For J = 1 To 5 Carry = 0 Shift X , Left $asm brcc no_carry $end Asm Set Carry No_carry: If Carry = 1 Then
in „Achtung, Newbie, LED-Ansteuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
read_cf_as.asm
equ D'1' CD1 equ D'2' org 0x00 init_pic bcf STATUS,RP0 bcf STATUS,RP1 clrf PORTA clrf PORTB clrf PORTC clrf PORTD clrf PORTE bsf STATUS,RP0 movlw 0x06 movwf ADCON1 movlw B'00001010' movwf TRISA movlw B'00000000' movwf TRISB movlw B'00000100' movwf TRISC movlw B'00000000' movwf TRISD movlw B'00000000' movwf TRISE bcf STATUS, RP0 clrf PORTA clrf PORTB clrf PORTC clrf PORTD clrf PORTE clrf lo_byte init_cf movlw B'00110001' movwf PORTA movlw B'00000000' movwf PORTB movlw B'00000001' movwf PORTC movlw B'00000000' movwf PORTD movlw B'00000000' movwf PORTE nop
in „CompactFlasch-Karte im Memory Mode ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD_DISPLAY16X2.txt
,20,50,15); // GPIOPortIntRegister(GPIO_PORTB_BASE, PortBIntHandler); // GPIOPortIntRegister(GPIO_PORTC_BASE, PortCIntHandler); // Initialisierung 16x2 LCD Display //set LCD_DATA0 , LCD_DATA1 , LCD_DATA2 , LCD_DATA3 , LCD_RS to output ports GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN
in „UDP Server mit LM3S6965“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Drehgeber.c
define PHASE_A (PIND & 1<<PD7) #define PHASE_B (PINB & 1<<PB0) #define LEDS_DDR DDRC #define LEDS PORTC // LEDs against VCC volatile int8_t enc_delta; // -128 ... 127 static int8_t last; //Gloale Variablen int8_t i=1; //Funktionen void encode_init( void ) { int8_t neu; neu = 0; if( PHASE_A ) neu = 3;
in „Mikrocontroller hängt Interrupt schuld?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DisplayAtmega8.c
#define F_CPU 8000000UL #include <avr/io.h> #include <util/delay.h> #define LCD_DATA PORTC #define LCD_DATADDR DDRC #define LCD_Control PORTD #define LCD_ControlDDR DDRD #define _RS 0x01 #define _RW 0x02 #define _Enable 0x04 int main (void){ DDRB = 0x02; LCD_DATADDR = 0xFF; // LCD_DATA als
in „Atmega8 LCD Fehler im Programm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pwm.c
Standard setzten DDRC |= (1 << DDC2); DDRB |= (1 << DDB2); pwm_position = 0; // PWM deaktivieren PORTC |= (1<<PC2); // BLANK HIGH => LEDs OFF PORTB &= ~(1<<PB2); // XLAT LOW } void SetLED(uint8_t led, uint16_t value) { uint8_t adr; if (led%2 == 0 || led == 0) { // Blöcke 0, 2, 4, ... adr = (led * 3)
in „Atmega48 - UART als Interrupt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
regelung4.c
Berechnungen // // Atmega16 16MHz Takt // AD-Wandlerkanal ADC0, Bereich 0-5V, 8-bit // Ausgabe binär am PortC (für R/2R Netzwerk) // // Timer0 soll jedesmal bei Overflow (jede 128us) den AD-Wandler für eine Einzelwandlung zünden // Anschl. erfolgt eine Berechnung mit dem gewandelten Wert, dabei wird PORTC
in „Timer und ADC bei Atmega16 mit WinAVR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
regelung4.c
Berechnungen // // Atmega16 16MHz Takt // AD-Wandlerkanal ADC0, Bereich 0-5V, 8-bit // Ausgabe binär am PortC (für R/2R Netzwerk) // // Timer0 soll jedesmal bei Overflow (jede 128us) den AD-Wandler für eine Einzelwandlung zünden // Anschl. erfolgt eine Berechnung mit dem gewandelten Wert, dabei wird PORTC
in „Timer und ADC bei Atmega16 mit WinAVR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
vs1001.h
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define DREQ_PORT PORTC #define BSYNC_PORT PORTC #define MP3_PORT PORTC #define RESET_PORT PORTB #define DREQ_PIN PC2 // DREQ signal #define BSYNC_PIN PC1 // BSYNC signal #define MP3_PIN PC0 // MP3 control bit #define RESET_PIN
in „mp3-Player mit Atmega8 und vs1011e spielt nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TimerundUart.txt
; //Timer/Counter Control Register auf CK/8 und CTC-Mode sei(); //All Interrupt enable DDRC=0xFF; PORTC=0x00; } void UART_Init (void) { UBRRL = F_CPU / (16 * 9600UL) - 1; /*Enable reciever and transmitter */ UCSRB = (1<<RXEN) | (1<<TXEN) ; /*Set Frame format :8data, 1stop bit */ UCSRC = (1<<URSEL) |
in „GCC + Interrupt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Code_Atmega88.c
void stateMachine(void) { if (!dataReady) return; switch (receivebuffer[0]) { case UDS_WRITE_DATA: PORTC = 0xFF; UART_Transmit(0x44); if(receivebuffer[1]== 0x33) { UART_Transmit(0x55); } break; case UDS_READ_DATA: PORTC = 0x00; UART_Transmit(0x77); if(receivebuffer[1]== 0x33) { UART_Transmit(0x55); }
in „mehrere Zeichen per UART empfangen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Blinker-LowPower.c
gotTick = 0; void setupIO() { // make Inputs & enable Pullup DDRB = 0x00; PORTB = 0xFF; DDRC = 0b00; PORTC = 0xff; DDRD = 0x00; PORTD = 0xff; // Set Power Reduction Register //PRR = 1<<PRTWI | 1<<PRTIM0 | 1<<PRTIM1 | 1<<PRSPI | 1<<PRUSART0 | 1<<PRADC; PRR = ~(1<<PRTIM2); } void setLed(uint8_t on) { if (on) { DDRC = 1<<PC5; PORTC = ~(1<<PC5); // C5 low } else { DDRC = 0x00; // input PORTC = 0xff; // pullup } } void setupTimer() { // using Timer 2 to create interrupt on compare // Asynchronous Status Register ASSR = 0b00000000
in „Stromverbrauch RC-Oszillator vs Quarz vs Resonator (AVR)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TEST.asm
Systemtakt in Hz .equ BAUD0 = 76800 .equ cr= 13 ;ASCII-Code für CR ;Eingangsmelde LEDs .equ led1_port= portC .equ led1_ddr= ddrC .equ led1_bit= pc0 .equ led2_port= portC .equ led2_ddr= ddrC .equ led2_bit= pc1 .equ led3_port= portC .equ led3_ddr= ddrC .equ led3_bit= pc2 .equ led4_port= portC .equ led4_ddr= ddrC .equ led4_bit= pc3 .equ led5_port= portC .equ led5_ddr= ddrC .equ led5_bit= pc4 .equ onled_port= portC .equ onled_ddr= ddrC .equ onled_bit= pc5 ;******************************* .def buffer = r0 .def srsk =r3 ;SREG-Siko .def null=r5 ;immer
in „Vorzeichen Ausgeben“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
MMC_Mega8.asm
= DDRC .equ SPI_DI_DDR = DDRC .equ SPI_CL_DDR = DDRC .equ Chip_Sel_DDR = DDRC .equ SPI_DO_Port = PortC .equ SPI_DI_Port = PortC .equ SPI_CL_Port = PortC .equ Chip_Sel_Port = PortC .equ SPI_DI_Pin = PinC .equ SPI_DO_PNr = 2 .equ SPI_DI_PNr = 3 .equ SPI_CL_PNr = 1 .equ Chip_Sel_PNr = 0 .cseg rjmp start
in „CID-Register bei MMC / Frage an Uli“ · Mikrocontroller und Digitale Elektronik ·