-
Datei
lcd.c
DB6 (pin 13) ------ bit 6 // DB7 (pin 14) ------ bit 7 // Makros fuer das RS-Signal #define LCD_RS PORTC.0 #define LCD_DR 1 #define LCD_IR 0 // Makros fuer das RW-Signal #define LCD_RW PORTC.1 #define LCD_READ 1 #define LCD_WRITE 0 // Makros fuer das EN-Signal #define LCD_EN PORTC.2 #define LCD_EN_SET
in „lcd.c - Testprogramm - Wie kompiliere ich das richtig?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
fremd.bas
Config Lcd = 16 * 2 Config Lcdbus = 4 Config Lcdpin = Pin , Db4 = Porta.5 , Db5 = Porta.7 , Db6 = Portc.1 , Db7 = Portc.3 , E = Porta.3 , Rs = Porta.1 'Config Lcdpin = Pin , E = Portd.1 , Rs = Portd.3 , Db7 = Portd.7 , Db6 = Portd.6 , 'Config Lcdpin = Pin , Db5 = Portd.5 , Db4 = Portd.4 'Config Lcd = 16 * 2 'Config Rc5 = Pinc.4 Config Rc5 = Pind.4 'Config Portc.0 = output Config Portb.0 = Output 'Portc.4 = 1 '???????????????????????????? Portd.4 = 1 Initlcd Cls Lcd "Address: " Locate 2 , 1 Lcd "Command: " Enable Interrupts Do Getrc5(address , Command) If
in „Mal wieder RC5 und Bascom“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PWMTest.c
TIMER2_COMP_vect) { ll_count++; // liveled } // Compare Match Timer 0 ISR(TIMER1_COMPA_vect) { // PORTC ^= (1<<PC7); PORTC ^= (1<<PC7); } ISR(TIMER1_OVFL_vect) { // PORTC &= ~(1<<PC7); // PORTC ^= (1<<PC7); }
in „ATMega16 und PWM“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Frage.bas
Rot ist Register 2 Gelb ist Register 3 ') Ddrc = &B11111111 'DDRC: ALLE AUSGANG Shift_data Alias Portc.2 'DS an PortC.2 Latch Alias Portc.1 'STCP an PortC.1 Sck Alias Portc.0 'SCK = SHCP an Portc.0 Ddrd = &B00000000 'DDRD: alle Eingang Portd = &B11111111 'Alle Pullups in PortD auf high Taster1 Alias
in „Einzelne Bits eines Bytes ändern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD_eigen_01.BAS
at 9600 baud Declare Sub Getline(s As String) Declare Sub Flushbuf() Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portd.5 , Rs = Portd.4 Config Lcd = 40 * 2 'configure lcd screen Dim I As Byte , B As Byte Dim Sret As String * 32 , Stemp As String * 6 Dim
in „Rückgabewert vom gsm-modul auf lcd“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pwm.bas
As Byte Dim A As Byte Dim Phase As Bit Dim Index As Byte Dim Los As Byte Dim Ind As Byte Pwm Alias Portc.0 Pw Alias Portc.1 ' Pwm Ausgang Config Timer0 = Timer , Prescale = 8 On Timer0 Timer0_isr ' bei Timer0 ueberlauf zur sub Config Portd = Input Config Portc = Output Portc = 255 Portd = 255 Enable Timer0
in „LCD-Hintergrund dimmen mit FASTAVR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
can.txt
canreg_write(unsigned char adresse, unsigned char daten) { PORTA |= (1<<0); // ALE Setzen pause(); PORTC = adresse; pause(); PORTA &= ~(1<<0); // ALE rücksetzen pause(); PORTA &= ~(1<<3); // ~WR rücksetzen pause(); PORTC = daten; pause(); PORTA |= (1<<3); // ~WR setzen //PORTA |= (1<<0); // ALE Setzen
in „SJA1000 und ATmega32A“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Tastereinlesen.c
erstellen void PortInit () //Unterprogramm Ports Initialisieren { DDRC = 0xFF; //Port C als Ausgang PORTC = 0x00; //Alles Leds aus an C DDRA = 0x00;; //PORT A als Eingang PORTA = 0xFF; //Pull Up's an Port A aktiviert _delay_ms(1); //1ms warteb bis alles aktiviert } void GetKeys () //Unterprogramm Taster
in „Probleme mit globaler Variable“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
_C_GLCD.bas
Word Const Timer1preload = 58336 'Config Graphlcd = 240 * 128 , Dataport = Portd , Controlport = Portc , Ce = 2 , Cd = 3 , Wr = 0 , Rd = 1 , Reset = 4 , Fs = 5 , Mode = 8 'Config Graphlcd = 240 * 128 , Dataport = Portd , Controlport = Portc , Ce = 2 , Cd = 3 , Wr = 0 , Rd = 1 , Reset = 4 , Fs = 5 ,
in „GLCD + Touchscreen machen in verbindng mit SPI probleme [Bascom]“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test.c
0b00000000,0b00000000,0b00000000,0b00111100,0b00000000,0b00000000,0b00111100,0b00000000,0b00000000,0b00000000} #define ShiftPort PORTC #define ShiftDDR DDRC #define LATCH (1 << 0) #define DATA (1 << 1) #define CLK (1 << 2) typedef unsigned char u8; typedef unsigned int u16; unsigned int txtl = 5; unsigned int text_1[5][10] = {H,A,
in „Schiebregister“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd.asm
write_LCD ; Schreiben movlw a' ' ; ASCII-Zeichen 'H' call _write_LCD ; Schreiben movlw b'10000000' movwf PORTC start2 movlw d'60' ;1ms*x movwf z2 call delay rlf PORTC, ;links btfss PORTC,7 ;bit7=0? decfsz z3 goto start2 goto main start3 movlw d'50' ;1ms*x movwf z3 call _LCD_clear call _line_1 movlw a'L' ; ASCII-Zeichen
in „PIC 16F887 Display 4x20 Stellen ansprechen ASM“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Schachtest.c
y2+1))&&(x3==(x2-1))) { if((Position[(x2-1)][(y2+1)])==0) { CHECK=FALSE; } } } else if (Seite==0) {PORTC |= (1<<PC4); if(Position[x3][y2]==Position[x2][y3+1]) {PORTC |= (1<<PC3);//Wieso ist er hier mehr als 1x drin if(Position[x3][y2-1]==0) {PORTC |= (1<<PC2); CHECK=TRUE; } else if(Position[x3][y2-1]!=0) {PORTC |= (1<<PC1); CHECK=FALSE; } } else if(Position[x3][y2]==Position[x2-1][y3-1]) {PORTC |= (1<<PC2); if((Position[(x2-1)][(y2-1)])==0) { CHECK=FALSE; } else { CHECK=TRUE; } } else if((y3==(y2-1))&&(x3
in „'y' may be used uninitialized in this function“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
dimmer.c
Zündung einstellen outp(zuendung, TCNT1L); sbi(TIMSK,TOIE1); } SIGNAL (SIG_OVERFLOW1) // Zuendung { sbi(PORTC,PC4); sbi(PORTD,PD1); cbi(TIMSK,TOIE1); } SIGNAL (SIG_OVERFLOW2) // letzter Nulldurchgang ist 9.9 ms her -> Triac abschalten { cbi (PORTD,PD1); cbi (PORTC,PC4); } SIGNAL(__vector_default){} SIGNAL(
in „Dimmer flimmert“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
uarttest.asm
Bit out UCSRC, temp sbi UCSRB,TXEN ; TX aktivieren sbi UCSRB, RXEN ; RX aktivieren sbi DDRC, 5 ; PORTC 5 Ausgang cbi PORTC, 5 ; LED an receive_loop: sbis UCSRA, RXC ; warten bis ein Byte angekommen ist rjmp receive_loop in temp, UDR ; empfangenes Byte nach temp kopieren sbi PORTC, 5 ; LED aus ldi data
in „Undefined variable referenced...“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Mega8-8Mhz-Test.bas
= &H00 MCUCR.0 = 0 MCUCR.1 = 1 MCUCR.2 = 0 MCUCR.3 = 1 Enable Interrupts Enable Int0 Enable Urxc PORTC = 255 Kanal(0) = 255 Kanal(1) = 255 Kanal(2) = 255 Kanal(3) = 255 Do Loop Interrupt Int0() PORTC = 255 'Optokoppler aus Durchlauf = 0 Halbwelle = 0 Schalten() Start Timer1 Enable Oc1A Compare1=313
in „DMX Dimmerpack bauen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
0xFF; while(1) // Forever loop { //options(); pot_init(0xA0); // On STK500, 1 = LED off, 0 = LED on PORTC = 0xFE; // Initial value for LED chaser _delay_ms(speed); // Loop 8 times, once for each bit for(unsigned char i = 0; i <8; i++) { adc(); // Rotate the value through PORTC PORTC = (PORTC << 1) | 0x01
in „ATmega16 auf STK500: SPI->DigiPoti Verbindung funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
= 0b00000000; TRISC = 0b00000000; //Ausgänge auf 0 setzen PORTA = 0b00000000; PORTB = 0b00000000; PORTC = 0b00000000; //Eingänge definieren TRISA.0 = 1; TRISC.0 = 1; //Variablen unsigned char sekunde=0, minute=0, stunde=0, takt=0, counter=0; //TIMER setzen T0CS = 0; //Schleife beginnen while(1) { //Sekunden
in „Probleme beim Compilieren von .c zu .hex“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
port.c
and then sending it high again { USARTC0.CTRLB = 0x00; // Disable USART receiver and transmitter PORTC.DIR |= (1 << PIN3); // Set port C pin3 (tx) to output PORTC.OUT |= (1 << PIN3); PORTC_OUTTGL |= (1<<PIN3); startTimer(0x01F4); // wait for about 2ms waitForTimer(); PORTC_OUTTGL |= (1 << PIN3); //
in „Atxmega128a1-SRF01“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
bftag.asm
zerleg rcall BCD ; eingang auswerten, display aktivieren, delay abwarten ldi temp, 0b00000001 out portc, temp clr temp ;hier delay interrupt ;counter: ; counterauswertung mov zerleg, count hunderter: ;anzahl der hunderter nach temp cpi zerleg, 100 brlo hout inc temp rjmp hunderter hout: ; hunderter ausgeben rcall BCD ldi temp, 0b00001000 out portc, temp clr temp ; hier delay inerrupt zehner: ;anzahl der zehner nach temp cpi zerleg, 10 brlo zout inc temp rjmp zehner zout: ; zehner ausgabe rcall BCD ldi temp, 0b00000100 out portc, temp clr temp
in „7 Segmetanzeigen mit ATMega8“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
T6963_V12.asm
PORTC, 0 clrf Command movlw 0x80 movwf Command call writecommand0 ; OR Mode und int. CG RAM Mode bsf PORTC, 2 clrf Command clrf CommandData1 clrf CommandData2 movlw 0xFF movwf CommandData1 movlw 0x03 movwf
in „T6963C Versorgungspannung“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
T6963_V12.asm
PORTC, 0 clrf Command movlw 0x80 movwf Command call writecommand0 ; OR Mode und int. CG RAM Mode bsf PORTC, 2 clrf Command clrf CommandData1 clrf CommandData2 movlw 0xFF movwf CommandData1 movlw 0x03 movwf
in „Wer Fragen zu LCD's hat soll sie in diesem Beitrag stellen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
StateMachine.asm
retInc cpi Mins, 59 breq _retInc inc Mins clr Secs _retInc: ret incState: inc State; ret State0: out PORTC, State ret State1: out PORTC, State push r28 in r28, TCCR1B ori r28, (1<< CS12) out TCCR1B , r28 pop r28 rcall incState ret State2: out PORTC, State ret State3: out PORTC, State in r28, TCCR1B andi r28, 0b11111000 out TCCR1B, r28 rcall incState ret State4: clr State out PORTC, State ret delay50us: ; 50us Pause ldi r25, ( XTAL * 50 / 3 ) / 1000000 delay50us_: dec r25 brne delay50us_ ret ; wieder zurück ; ; Ende Quellcode
in „Registerinhalt ändert sich“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
StateMachine.asm
retInc cpi Mins, 59 breq _retInc inc Mins clr Secs _retInc: ret incState: inc State; ret State0: out PORTC, State ret State1: out PORTC, State push r28 in r28, TCCR1B ori r28, (1<< CS12) out TCCR1B , r28 pop r28 rcall incState ret State2: out PORTC, State ret State3: out PORTC, State in r28, TCCR1B andi r28, 0b11111000 out TCCR1B, r28 rcall incState ret State4: clr State out PORTC, State ret delay50us: ; 50us Pause ldi r25, ( XTAL * 50 / 3 ) / 1000000 delay50us_: dec r25 brne delay50us_ ret ; wieder zurück ; ; Ende Quellcode
in „Registerinhalt ändert sich“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Forum.c
High PORTC |= (1<<PC0); //PC0 = Servo 8 auf High ServoNr=0; if (oeffnen==1) //ersten OCR1B Wert setzen je nachdem ob Fahrwerk offen oder zu { OCR1B = servos_open[ServoNr].when; //Beim Timerdurchlauf Top quasi
in „Debug-Problem in AVR-Studio 5“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
on.c
**************************/ #define SPIF 7 #define CSB PORTB.6 #define SS PORTB.2 #define LED_rot PORTC.3 // Output rote LED #define LED_gelb PORTC.2 // Output gelbe LED #define LED_gruen PORTC.1 // Output grüne LED #define BUZZER PORTC.0 // Output Buzzer /********************************************
in „SPI ATmega8L Beschleunigungssenor“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
Samsung_20S204DA2_v1.1.pdf
Muetze1 * */ #include <avr/io.h> #include <util/delay.h> // connection: // PORTB[0..7] = DB[0..7] // PORTC = control lines (see below) #define PIN_WR PC0 #define PIN_SEL PC1 #define PIN_BUSY PC2 void outc(char a) { PORTC &= ~(_BV(PIN_WR) | _BV(PIN_SEL)); PORTB = a; _delay_us(1); // delay 50 ns PORTC |= _BV(PIN_WR); _delay_us(1); // delay 50 ns PORTC |= _BV(PIN_SEL); // check BUSY signal // while ( PINC & _BV(PIN_BUSY) ) // ; // or wait max time _delay_us(500); } void outs(const char * s) { while ( s && *s ) outc(*s++); } int main(void) { DDRB
-
Datei
dmxtester2.bas
8000000 $baud = 250000 Config Kbd = Portb , Debounce = 20 , Delay = 50 Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2 Config Lcd = 20 * 4 Config Pind.7 = Output Config Pind.6 = Output Config Pind.5 = Output Config Adc = Single , Prescaler
in „DMX Empfang in C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Atmega48_LED_Test.c
sein - in diesem Fall ist es der DataPin vom DS1820 #define W1_IN PINC //Pin abfragen #define W1_OUT PORTC //Ausg?nge ansteuern #define W1_DDR DDRC //Datenrichtung jeweils festlegen - je nach dem ob daten zum DS gesedent, oder vom DS empfangen werden sollen #define LED_OUT PORTB #define LED_DDR DDRB #define
in „Anfängerfrage zu switch case“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
main(){ uint8_t i, k, n, c, p=1, x=5, y=2, s=3, led[12][10]; DDRC = 0x0f; DDRD = 0xf0; DDRB = 0xff; PORTC = 0x00; PORTD = 0x00; PORTB = 0x00; for(i=0;i<12;i++){ for(k=0;k<10;k++){ led[i][k]=0; } } while(1){ if(((PIND & (1<<0)) == (1<<0))&&p!=2){ p=1; } if(((PIND & (1<<1)) == (1<<1))&&p!=1){ p=2; } if((
in „Problem beim Pin-Abfrage“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.cpp
PD4) # define InSemiOn !(PIND & (1<<PD5)) # define InSemiOff PIND & (1<<PD5) # define OutTriggerOn PORTC &= ~(1 << PC0) # define OutTriggerOff PORTC |= (1 << PC0) # define OutSemiOn PORTC &= ~(1 << PC1) # define OutSemiOff PORTC |= (1 << PC1) # define OutReloadOn PORTC &= ~(1 << PC2) # define OutReloadOff PORTC |= (1 << PC2) #define KEY_DDR DDRB #define KEY_PORT PORTB #define KEY_PIN PINB #define KEY0 7 #define ALL_KEYS (1<<KEY0) #define REPEAT_MASK (1<<KEY0) // repeat: key0 #define REPEAT_START 50 // after
in „ATmega328p fehlerhafte UART-Anzeige mit bootloader“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
ADC_ApplicNotes.pdf
disabled, SPI system on, * DWOM mode, 68hc11 is master, * CPOL 0, CPHA 1, SCK=ECK/32 * ldy #$1000 bset portc,y $03 TFS and RFS set high * bset portc,y $08 A0 high to read data * bclr portc,y $08 A0 low to read from cal. reg * ldaa spsr Initial dummy read to clear port and SPIF ldaa spdr * ldab #$03 b is 0
in „ADC-Überspannungschutz mit Z-Diode; Einfluss auf die Messgenauigkeit“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
system.txt
Anlegen der Bedienelementliste */ st_controls = newUserControl(st_controls, &PORTA, PA4, &PORTA, PA0, &PORTC, PC0); st_controls = newUserControl(st_controls, &PORTA, PA5, &PORTA, PA1, &PORTC, PC1); st_controls = newUserControl(st_controls, &PORTA, PA6, &PORTA, PA2, &PORTC, PC2); st_controls = newUserControl(st_controls, &PORTA, PA7, &PORTA, PA3, &PORTC, PC3); st_controls = newUserControl(st_controls, &PORTB, PB4, &PORTB, PB0, &PORTD, PD0); st_controls = newUserControl(st_controls, &PORTB, PB5, &PORTB, PB1, &PORTD, PD1); st_controls = newUserControl
in „JTAG AVR Debugging und malloc“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.c
7.3728Mhz #include <iom8v.h> #include <macros.h> void port_init(void) { PORTB = 0x3C; DDRB = 0x00; PORTC = 0x0F; DDRC = 0x0F; PORTD = 0x00; DDRD = 0x00; } //UART0 initialize // desired baud rate: 2400 // actual: baud rate:2400 (0,0%) // char size: 8 bit // parity: disabled void uart0_init(void) { UCSRB
in „UART-/Portinitialisierung (Anfängerproblem) läuft schief“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Codeabschnitt.txt
/////////////////////// if (Command == 0b00000101 && EmpfangeAufstromzeit == 1) { cli(); buesy=1; PORTC |=(1<<PC5); long_delay(Aufstromzeit); PORTC &= ~(1<<PC5); Command = 170; sei(); buesy = 0; } if (AnzahlBytes == 5 && Command == 0b10101010 && EmpfangeAufstromzeit == 1) { cli(); Command=0; buesy=1; t=0; while(t==0) { PORTC |=(1<<PC2); // START pin of ADS high level PORTC &=~(1<<PC2); // START pin low again PORTD &= ~(1<<PD2); //CS low for (int i=0; i<=4; i++) { SPI_Senden(adc_read_com[i]); register_status[i] = SPI_Empfangen
in „Problem: 16 Bit Variable über UART zu empfangen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
CAM.bas
11059200 Config Portb.0 = Output Cts Alias Portb.0 Config Portd.6 = Output Rts Alias Portd.6 Config Portc.0 = Output Led Alias Portc.0 Config Portc.3 = Output Mob_ein Alias Portc.3 Config Portc.1 = Output Mob_opto Alias Portc.1 Config Serialin = Buffered , Size = 254 Enable Interrupts Disable Int0 Declare
in „IQP 500 GSM Bildübertragung Tonerätzverfahren“ · Projekte & Code ·
-
Datei
kty81_110.bas
Deflcdchar 0 , 6 , 9 , 9 , 6 , 32 , 32 , 32 , 32 ' LCD-Sonderzeichen 'Pins von Port C definieren Config Portc = Input 'PinC.0=Taster3, PinC1=Taster4, PinC.2=IR-Empfänger, PinC.3=Poti Wait 100 Portc = &H00 'pullup Ausschalten 'Pins für I2C-Bus definieren 'Config Sda = Portc.4 'Config Scl = Portc.5 'AD-Wandler
in „AtMega8 ADC4 ADC5 haben 5V“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.c
Port_a; int Port_c; int Port_d; void set_Porta(int Port_a); void set_Portb(int Port_b); void set_Portc(int Port_c); void set_Portd(int Port_d); void reset_Porta(int Port_a); void reset_Portb(int Port_b); void reset_Portc(int Port_c); void reset_Portd(int Port_d); void wait(int wait2);/*Funktiond Header
in „AVR Stürzt ab --> interner Reset Hilfe“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
regelung.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 „Timer0 gesteuerter AD-Wandler“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
regelung.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 „Timer0 gesteuerter AD-Wandler“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Schrittmotor.c
uint8_t xStepIn = 0; #define STATUS_LED_PORT PORTB #define STATUS_LED_PIN PB4 #define MOTOR_X_PORT PORTC #define PHASE_X_0 PC0 #define PHASE_X_1 PC1 #define PHASE_X_2 PC2 #define PHASE_X_3 PC3 ////////////////////////////////INT0 Interrpt//////////////////////////////////////////// ISR(INT0_vect) { xStepIn
in „Schrittmotor Steuerung Atmega16 Interrupt Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Leuchttest505_2_.asm
--------------------------------------------------- ;Notes ; PORTB: RB5:0 RB7:6 not implemented ; PORTC: RC5:0 RC7:0 " " ;--------------------------------------------------------------------- ;Files Required: P16F505.INC ;******************************************************************************
in „PIC16F505 reagiert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
bin_hr.txt
S2 = S2 + 1 If S2 = 10 Then 'wenn s2 = 10 dann reset sek2, set sek1 S1 = S1 + 1 S2 = 0 Portb.3 = 1 Portc.0 = 1 Waitms 10 Portb.3 = 0 Portc.0 = 0 Else End If 'Minuten: If S1 = 6 Then 'wenn sek1 = 6 dann reset sek1, set min2 M2 = M2 + 1 S1 = 0 Portb.5 = 1 Portd.6 = 1 Waitms 10 Portb.5 = 0 Portd.6 = 0 Else
in „Probleme mit Programmierung einer Binäruhr“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcdatmega8.c
************************************* ADMUX &=~(1<<MUX3)|~(1<<MUX2)|~(1<<MUX1)|~(1<<MUX0); //ADC0 PORTC|=(1<<PC1);// _delay_loop_2(5); for(int x=0;x<20;x++){ ADCSRA|=(1<<ADSC);//Messungs starten while(ADCSRA & (1<<ADSC)){;}//Messung abwarten IST_HAUS_1+=ADCW; } IST_HAUS_1/=20; PORTC&=~(1<<PC1);// //*********************************************************************** PORTC=(1<<PC2);// _delay_loop_2(5); for(int x=0;x<20;x++){ ADCSRA|=(1<<ADSC);//Messungs starten while(ADCSRA & (1<<ADSC)){;}//Messung abwarten IST_HAUS_2+=ADCW; } IST_HAUS_2/=20; PORTC&=~(1<<PC2); //****
in „Zwei analog Eingänge nacheinander abfragen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ueben.c
(); while(1) { therm_read_temperature(); updateVariableTemp(temp_aktuell); //PORTC = 0b11111110; //PORTD = getSegmentCode(3); } return 0; } uint8_t getSegmentCode (int zahl) { uint8_t code; switch (zahl) { case 1: code = 0b11111001; break; case 2: code = 0b10100100; break; case 3
in „DS18S20 bringt immer 127“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
I2C.asm
TRISD ; ...sind Ausgänge bcf STATUS, RP0 RDATA EQU H'20' ; Speicherzelle für I2C Daten ; ... für I2C (PORTC) banksel PORTC ; PortC... clrf PORTC ; ...initialisieren ; PortC, RC3 und RC4 als (SCL und SDA) Input bsf STATUS, RP0 ; Auf Bank 1 umschalten movlw B'00011000' ; RC3 und RC4 als Eingänge iorwf TRISC
in „PIC16F887 - LCD Toshiba 20x4 Zeichen - Assembler“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
on.c
**************************/ #define SPIF 7 #define CSB PORTB.6 #define SS PORTB.2 #define LED_rot PORTC.3 // Output rote LED #define LED_gelb PORTC.2 // Output gelbe LED #define LED_gruen PORTC.1 // Output grüne LED #define BUZZER PORTC.0 // Output Buzzer /********************************************
in „SPI ATmega8L Beschleunigungssenor“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
on.c
**************************/ #define SPIF 7 #define CSB PORTB.6 #define SS PORTB.2 #define LED_rot PORTC.3 // Output rote LED #define LED_gelb PORTC.2 // Output gelbe LED #define LED_gruen PORTC.1 // Output grüne LED #define BUZZER PORTC.0 // Output Buzzer /********************************************
in „SPI ATmega8L Beschleunigungssenor“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Empfangen.c
(1<<PD4) | (1<<PD2)); DDRC |= (1<<PC2); //PB4 als Ausgang -> Senden/Empfangen PORTD &=~ (1<<PD2); PORTC &=~ (1<<PC1); PORTC &=~ (1<<PC2); PORTC &=~ (1<<PC3); PORTC &=~ (1<<PC4); PORTC &=~ (1<<PC5); PORTD &=~ (1<<PD4); DDRD &= ~(1<<PD3); //INT 1 als Eingang PORTD |= (1<<PD3); // Pull up aktivieren EIMSK
in „RFM12b an Atmega168 - Empfangsprobleme“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
BLDC.c
Hall2 SBIT( PIND, 1 ) #define Hall3 SBIT( PIND, 2 ) #define ENW SBIT( PORTB, 1 ) #define ENV SBIT( PORTC, 4 ) #define W SBIT( PORTC, 3 ) #define V SBIT( PORTC, 2 ) #define ENU SBIT( PORTC, 1 ) #define U SBIT( PORTC, 0 ) #define Hall1_DDR SBIT( DDRD, 0 ) #define Hall2_DDR SBIT( DDRD, 1 ) #define Hall3_
in „BLDC dreht CCW schneller als CW?“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
Futaba_M202MD01BA_v1.0.pdf
Muetze1 */ #include <avr/io.h> #include <util/delay.h> // connection: // PORTB[0..7] = DB[0..7] // PORTC = control lines (see below) #define PIN_WR PC0 #define PIN_SEL PC1 #define PIN_BUSY PC2 void outc(char a) { #ifdef PIN_BUSY // check BUSY signal while ( (PINC & _BV(PIN_BUSY)) ) ; #endif PORTC &= ~_BV(PIN_SEL); PORTC &= ~_BV(PIN_WR); PORTB = a; PORTC |= _BV(PIN_WR); PORTC |= _BV(PIN_SEL); #ifndef PIN_BUSY // if not checking BUSY signal, wait some time _delay_us(150); #endif } void outs(const char * s) { while (