-
Datei
test1.c
ini_ee EEMEM; int main(void) { DDRC = 0xff; DDRC &= ~( 1 << PC0 ); /* PIN PB0 auf Eingang (Taster) */ PORTC |= ( 1 << PC0 ); DDRB &= ~( 1 << PB0 ); /* PIN PB0 auf Eingang (Taster) */ PORTB |= ( 1 << PB0 ); lcd_init(); set_cursor(0,1); _delay_ms(50); lcd_string("Stundenzaehler"); set_cursor(0,2); lcd_string
in „Fehler im Betrieb“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
} } int init_ausgang(void) { /*outp(0xFF, DDRC); // Alle Ports von C als Output setzen outp(0xFF, PORTC); // Alle LEDs aus */ DDRC=(1<<DDC0); PORTC=(1<<DDC0); } int ausgabe_on(void) { PORTC=(0<<DDC0); } int ausgabe_off(void) { PORTC=(1<<DDC0); } int init_eingang(void) { DDRA = 0x00; } int main(void)
in „GCC - USART -AVR -Integerwert am PC per RS232“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
} } int init_ausgang(void) { /*outp(0xFF, DDRC); // Alle Ports von C als Output setzen outp(0xFF, PORTC); // Alle LEDs aus */ DDRC=(1<<DDC0); PORTC=(1<<DDC0); } int ausgabe_on(void) { PORTC=(0<<DDC0); } int ausgabe_off(void) { PORTC=(1<<DDC0); } int init_eingang(void) { DDRA = 0x00; } int main(void)
in „GCC - USART -AVR -Integerwert am PC per RS232“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
} } int init_ausgang(void) { /*outp(0xFF, DDRC); // Alle Ports von C als Output setzen outp(0xFF, PORTC); // Alle LEDs aus */ DDRC=(1<<DDC0); PORTC=(1<<DDC0); } int ausgabe_on(void) { PORTC=(0<<DDC0); } int ausgabe_off(void) { PORTC=(1<<DDC0); } int init_eingang(void) { DDRA = 0x00; } int main(void)
-
Datei
main.c
} } int init_ausgang(void) { /*outp(0xFF, DDRC); // Alle Ports von C als Output setzen outp(0xFF, PORTC); // Alle LEDs aus */ DDRC=(1<<DDC0); PORTC=(1<<DDC0); } int ausgabe_on(void) { PORTC=(0<<DDC0); } int ausgabe_off(void) { PORTC=(1<<DDC0); } int init_eingang(void) { DDRA = 0x00; } int main(void)
in „UART-Interrupt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
uartinterrupt.asm
UDR für das nächste Byte bereit ist rjmp serout out UDR0, temp1 ret lcd_data: out PORTA, temp1 sbi PORTC, 5 rcall lcd_enable cbi PORTC, 5 rcall delay50us ret lcd_command: out PORTA, temp1 rcall lcd_enable rcall delay50us ret lcd_enable: sbi PORTC, 6 nop ; wieviel nops? nop nop cbi PORTC, 6 ret delay50us
in „RS232 empfangen + zurücksenden“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
VS1001.bas
$crystal = 8000000 $baud = 9600 Vs1001_chip_select Alias Portc.4 Vs1001_data_input Alias Pinc.7 Vs1001_data_output Alias Portc.6 Vs1001_clock Alias Portc.5 Vs1001_bsync Alias Portc.3 Config Pinc.4 = Output Config Pinc.5 = Output Config Pinc.7 = Input Config Pinc
in „Sd-Card Spec“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pwm.c
} sei(); } ISR(TIMER2_COMP_vect) { uint8_t ocr = OCR2, diff; uint16_t setmask = 0, clearmask = 0; PORTC |= _BV(PC0); if (!ocr) { clearmask = PWM_MASK_ALL; diff = 255; PORTC |= _BV(PC1); PORTC &= ~_BV(PC1); } else { diff = 0 - ocr; //256 - ocr } for (uint8_t i = 0; i < PWM_CHANNELS; ++i) { uint8_t d;
in „RGB Power LED Treiber“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
LED-Lauflicht.c
(1<<PC5))) // Wenn Taster 2 gedrückt: Lauflicht { for (i=0; i<20; i++) { PORTB = led_array[i][0]; PORTC = 0xF0 | led_array[i][1]; PORTD = led_array[i][2]; _delay_ms(300); } } else if (!(PINC & (1<<PC4))) // Wenn Taster 1 gedrückt wird: { PORTD ^= 0xFF ; // Toggle alle LEDs PORTB ^= 0xFF ; PORTC ^= (1
in „Verbesserungsvorschläge zu eigenem kleinen Programm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
twi_example.c
the processed value which will * be inverted and displayed after key release. */ int main(void) { PORTC.DIR =0xFF; PORTC.DIR |= (1<<PIN0); /* Initialize TWI master. */ TWI_MasterInit(&twiMaster, &TWIF, TWI_MASTER_INTLVL_LO_gc, TWI_BAUDSETTING); /* Enable LO interrupt level. */ PMIC.CTRL |= PMIC_LOLVLEN_bm
in „I2C mit Xmega128 Grundlagen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
regelung3.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
regelung3.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
interrupt_forum.c
and other beginners :) This program uses the pushbutton on the board to change the status of the PORTC-Pins. Debouncing is applied via Timer. The Timeroverflow generates an Interrupt. In the ISR I checkhow long the button has allready been pressed. I could extend the function to check for long pressed
in „externer Interrupt (Mega16, in C, SW-entprellt)“ · Projekte & Code ·
-
Datei
hd44780_settings.h
in mS /*#if (LCD_BITS==8) // If using 8 bit mode, you must configure DB0-DB7 #define LCD_DB0_PORT PORTC #define LCD_DB0_PIN 0 #define LCD_DB1_PORT PORTC #define LCD_DB1_PIN 1 #define LCD_DB2_PORT PORTC #define LCD_DB2_PIN 2 #define LCD_DB3_PORT PORTC #define LCD_DB3_PIN 3 #endif*/ #define LCD_DB4_PORT
in „ATmega16 und HD44780 in 4-Bit modus Hilfe!“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DCF-Uhr.bas
auftreten A_stunde = 08 A_wota = 1 Au_minute = A_minute + 2 Au_stunde = A_stunde Au_wota = A_wota Portc.0 = 0 'Diese zwei Ports sind für Portc.1 = 1 'die Relais ansteuerung '############################################################################### '#### Hauptprogramm ###########################
in „DCF-Uhr mit Alarmfunktion“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
dot.txt
for(;count < speed; count++) { clr(); } count = 0; } } void PoB5(uint8_t row) { PORTB= (1<<PB5); PORTC= row; delay(); } void PoB4(uint8_t row) { PORTB= (1<<PB4); PORTC= row; delay(); } void PoB3(uint8_t row) { PORTB= (1<<PB3); PORTC= row; delay(); } void PoB2(uint8_t row) { PORTB= (1<<PB2); PORTC= row; delay(); } void PoB1(uint8_t row) { PORTB= (1<<PB1); PORTC= row; delay(); } void PoB0(uint8_t row) { PORTB= (1<<PB0); PORTC= row; delay(); } void clr(void) { PORTB = 0; _delay_ms(2.5); } void delay(void) { _delay_ms(0.5); }
in „Programm für Dot Matrix Ansteuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
AVRTelx093.c
blinkt mehrmals kurz * test0 LED's 1-4 aufsteigend, 3 mal * test LED's 4-1 nacheinander aus, 3 mal * PORTC=3 scheint unverzichtbar zu sein, DDRC=3 hilft nicht. * Gehört wahrscheinlich zu PCF bzw. zu SDA u. SCL. * PORTD=1-Problem: wird durch errorpcf() verursacht, * wenn nicht,dann Abhilfe mit DDRD=1 (Port
in „beginnt Ablauf nict mehr bei main?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
ks0108Fill(CLEAR); frame(); ks0108GotoXY(2,2); ks0108PutString(teststring,smallFont); while(1) { PORTC = PORTC |(1<<PC0); //LED PC0 ein delay_ms(500); PORTC = PORTC & ~(1<<PC0); //LED PC0 aus delay_ms(500); teststring[4] += test; test++; if(test >=9) {test = 0;teststring[4]='0';} //frame(); ks0108Fill
in „Atmega128 USART fehler beim Compilieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Cube_7x7x8_3Mode.bas
-------------------------------------------------------------------- Config Porta = Output Config Portc = Output Config Portd = Output Config Pinb.0 = Input Config Pinb.1 = Input Config Pinb.4 = Output Config Pinb.6 = Output Config Pinb.7 = Output Pinb.0 = 0 Pinb.1 = 0 '------------------------------
in „Umsteigen von Bascom auf C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
clock.c
buf[DIGITS+1]; volatile uint8_t digit[16]; SIGNAL (SIG_OVERFLOW0) { if (pos == DIGITS) { pos = 0; } PORTC = 0x00; PORTB = buf[pos]; PORTC = (1<<pos); pos++; TCNT0 = 100; return; } void ioinit (void) { /* enable PORTC as output */ DDRA = 0xFF; PORTA = 0x00; DDRB = 0xFF; PORTB = 0x00; DDRC = 0xFF; PORTC
in „AVR Problem mit gcc?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Uhr.c
"h%02d:m%02d", c_hours, c_minutes); lcd_setcursor(0,2); lcd_string(buffer); if( debounce_D2() ){ PORTC ^= (1<<PC3); if(c_minutes <60) c_minutes++; else c_minutes = 0; } if( debounce_D3() ){ PORTC ^= (1<<PC2); if(c_hours <24) c_hours++; else c_hours = 0; } } } //********************** MAIN *************************************** int main(void) { PORTC=0xFF; PORTD=0xFF; DDRD=0x00; DDRC=0xFF; init(); while(1){ if (counter1 == 1){ clocktick(); counter1 = 0;} lcd_ausgabe(); _delay_ms(100); if( debounce_D1() ) { ZeitEinstellen(); } } return 0; }
in „Zeiteinstellung Uhr“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pwm_minimal.c
PC5 is 5 (see file include/avr/iom8.h) and _BV(PC5) is 00100000 */ while (1) { /* led on, pin=0 */ PORTC&= ~_BV(PC5); PORTC|= _BV(PC4); delay_ms(500); /* set output to 5V, LED off */ PORTC|= _BV(PC5); PORTC&= ~_BV(PC4); delay_ms(500); } return 0; }
in „3PWMs bei ATmega8 initialisieren, stimmts so?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ADC_To7Segm.c
7) PORTC &= ~PC_Bitmaske[number]; // ACHTUNG: Da die Bitmasken der Arrays (s. oben) jetzt nur die zu setzenden Bits markieren, muss das Modifizieren von PORTD &= ~PD_Bitmaske[number]; // PORTC und PORTD jetzt
in „Potentiometer mit ADU Atmega328PB [HILFE]“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LIN_1v1.c
---------- void Send_Byte(uint8_t sendByte){ DDRC = (1 << DDC2); //grüne LED einschalten (senden) PORTC |= (1<<PC2); while (!(UCSR0A & (1<<UDRE0))) //warten bis Senden möglich ; UDR0 = sendByte; // schreibt das Zeichen auf die Schnittstelle DDRC = (1 << DDC2); PORTC &= ~(1<<PC2); //grüne LED ausschalten
in „UART mit LIN-Protokoll“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD_Test.asm
TEMP1 out DDRB,TEMP1 out DDRC,TEMP1 out DDRD,TEMP1 ldi TEMP1,0 out PORTA,TEMP1 out PORTB,TEMP1 out PORTC,TEMP1 out PORTD,TEMP1 rcall lcd_init ;Display initialisieren rcall lcd_clear ;Display löschen ldi temp1, 'T' ;Zeichen anzeigen rcall lcd_data ldi temp1, 'e' ;Zeichen anzeigen rcall lcd_data ldi temp1
in „LCD springt nicht an“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Testprog_Nummeranzeige.c
// Variablen volatile uint8_t a,c; volatile uint8_t z; //Die Reset Leitung #define LED_RESET_PORT PORTC #define LED_RESET_DDR DDRC #define LED_RESET_PIN 5 //Die Select Leitung #define LED_SELECT_PORT PORTC #define LED_SELECT_DDR DDRC #define LED_SELECT_PIN 4 //Die Bright Leitung #define LED_BRIGHT_PORT PORTC #define LED_BRIGHT_DDR DDRC #define LED_BRIGHT_PIN 6 //Die rote LED Datenleitung #define LED_RED_PORT PORTD #define LED_RED_DDR DDRD #define LED_RED_PIN 4 //Die grüne LED Datenleitung #define LED_GREEN_PORT
in „ATmega32 & SLM Module Probleme beim Ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Spannungs_berwacher.bas
Portd.5 Config Lcd = 16 * 2 Waitms 100 Cursor Off Config Portd = Output Config Portb = Output Config Portc.4 = Output Led1 Alias Portc.4 Config Portc.5 = Output Led2 Alias Portc.5 Config Timer1 = Timer , Prescale = 8 Enable Timer1 On Timer1 Isr_von_timer1 Enable Interrupts Timer1 = 55000 Config Adc = Single
in „ADC und Timer funktionieren nicht zusammen in Bascom“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Inkrementalgeber-test3.cc
Endschalter), dann ** wird vorne umdefiniert zu Schritt nach links */ int main( void ) { DDRC = 0xFF; // PORTC als Ausgang for(;;) { MotorStepForward(); // Motor mach einen Schritt nach "vorne" MotorStepBackward(); // Motor mach einen schritt zurück } } void MotorStepForward() { // bei erreichen der Endschalter
in „Drehrichtungsumkehr.Microcontroller Programm funzt nicht richtig.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
neu.c
/// if (debounce(&PIND, PD2)) { zvsignal = zvsignal +1; zvtime = 0; } if (zvtime == zvwaittime) { PORTC &= ~(1<<PC1); _delay_ms(100); PORTC |= (1<<PC1); if (zvsignal == 1) { zuendung = 0; } if (zvsignal == 2) { zuendung = 1; } if (zvsignal == 3) { zuendung = 0; } zvsignal = 0; zvtime = 0; } /////////
in „Hilfe, ich finde den Fehler im Code nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
GY560B5.bas
m88def.dat" $crystal = 22118400 '$baud = 19200 Config Lcdpin = Pin , Rs = Portb.0 , E = Portd.0 , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 Config Lcd = 16 * 2 Config Adc = Single , Prescaler = Auto , Reference = Avcc : Start Adc Config Portb.1 = Output , Portd.3 = Output , Portd.7 = Output
in „ATmega8. Umbau als 2GHz Frequenz-Logger“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
BROWNOUT,NOMCLR #use delay (clock=4000000) // 4MHz clock #rom 0x3ff={0x3444} #byte PORTA = 0x05 #byte PORTC = 0x07 #byte TRISA = 0x85 #byte TRISC = 0x87 #define SPORTA PORTA #define SPORTC PORTC #define TICKS_BETWEEN_INTERRUPTS 5000 //5000 #define INTERRUPT_OVERHEAD 35 #define TMR1RESET (0xFFFF-(TICKS_BETWEEN_INTERRUPTS-INTERRUPT_OVERHEAD
in „Hex- bzw C-File in asm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
7segm_kont.asm
Hunderter als bcd nach r16 brlt hout subi r23, 100 inc r16 rjmp hloop hout: ldi r22, 0b00000010 out PORTC, r22 RCALL BCD clr r16 zloop: cpi r23, 10 ;Zehner nach als bcd nach r16 brlt zout subi r23, 10 inc r16 rjmp zloop zout: ldi r22, 0b00000100 out PORTC, r22 RCALL BCD ;einer output mov r16, r23 ldi r22, 0b00001000 out PORTC, r22 rcall BCD rjmp start
in „7 Segmetanzeigen mit ATMega8“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
leddemo.asm
sbrc XL,1 rcall key2released ;Taste gerade losgelassen! sbis GPIOR0,KEY0 ;Funktionalität [A] cbi PORTC,0 sbic GPIOR0,KEY0 sbi PORTC,0 movw ZH:ZL,r15:r14 movw YH:YL,r13:r12 movw XH:XL,r11:r10 out SREG,TSREG return: reti keyproc: adiw ZH:ZL,2 ;Tastenstatus entprellend ermitteln in YH,GPIOR0 mov YL,YH
in „AVR braucht 7us-12us bis in Interrupts ausgelöst wird??“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
zuMain_Kurz.c
ADCON0 = 0; // A/D CONTROL REGISTER 0 --> ADC aus OPTION_REG = 0b.0000.0000; // siehe DB; //... // PORTC-Init: WPUC = 0; // Weack-PullUps: 0 = aus; 1 = an; (je Pin ein Bit) PORTC = 0; LATC = 0; ANSELC = 0b.0000.0000; // 0 = digital, 1 = analog TRISC = 0b.1111.1111; // In = 1; Out = 0; // PORTC.0 // I2C_CLK PIN 10 // PORTC.1 // I2C_SDA PIN 9 InitI2C(); //...Init_LCD();... while(1) { // MRT-Wert zu GY-302 schicken if(writeMTR(31)) // wenn Slave nicht antwortet { ClearLCD(); // Display löschen, CursorPosition(2,1); //
in „I2C Initialisierung (Master) PIC16F1704“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
leddemo.asm
sbrc XL,1 rcall key2released ;Taste gerade losgelassen! sbis GPIOR0,KEY0 ;Funktionalität [A] cbi PORTC,0 sbic GPIOR0,KEY0 sbi PORTC,0 movw ZH:ZL,r15:r14 movw YH:YL,r13:r12 movw XH:XL,r11:r10 out SREG,TSREG return: reti keyproc: adiw ZH:ZL,2 ;Tastenstatus entprellend ermitteln in YH,GPIOR0 mov YL,YH
in „Codename Brillo: Googles /besonders/ kompaktes Betriebssystem für das Internet der Dinge“ · Haus & Smart Home ·
-
Datei
leddemo.asm
sbrc XL,1 rcall key2released ;Taste gerade losgelassen! sbis GPIOR0,KEY0 ;Funktionalität [A] cbi PORTC,0 sbic GPIOR0,KEY0 sbi PORTC,0 movw ZH:ZL,r15:r14 movw YH:YL,r13:r12 movw XH:XL,r11:r10 out SREG,TSREG return: reti keyproc: adiw ZH:ZL,2 ;Tastenstatus entprellend ermitteln in YH,GPIOR0 mov YL,YH
-
Datei
Beleuchtung_vorlaeufig.txt
as PORTB.6 #define LED6 as PORTD.5 #define LED7 as PORTD.6 #define LED8 as PORTD.7 #define LED9 as PORTC.0 #define LED10 as PORTC.1 #define LED11 as PORTC.2 #define LED12 as PORTC.3 #define S1 as PortC.4 #define S2 as PortC.5 LED1.mode =output LED2.mode =output LED3.mode =output LED4.mode =output LED5
in „Atmega 8 / Abfrage einer bestimmten Reihenfolge“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SED133x.bas
Gosub Lcd_write_pixel $regfile = "4433def.dat" $crystal = 8000000 Ddrd = $ff Portd = 255 Ddrc = $ff Portc = 255 Lcd_io_a0 Alias Portc.0 ' SED A0 (C/D) Lcd_io_cs Alias Portc.1 ' SED /CS Lcd_io_wr Alias Portc.2 ' SED /WR Lcd_io_rd Alias Portc.3 ' SED /RD Lcd_io_out Alias Portd ' SED 8 bit data Lcd_io_dir
in „Ansteuerung Grafikdisplay mit SED133x in BASCOM“ · Projekte & Code ·
-
Datei
G-LCD.asm
;;;;;;;;;;;;;;;;; .include "m8515def.inc" .equ CD =0 .equ CE =1 .equ WR1 =2 .equ RD1 =3 .equ dcmd=PORTC ; Display Command .equ ddata=PORTB ; Display Data ; Variablen festlegen .equ Command =0x0060 .equ CommandData1 =0x0061 .equ CommandData2 =0x0062 .equ loops =0x0063 .equ loops2 =0x0064 ; Stackpointer Initialisierung LDI r16,LOW(RAMEND) OUT SPL,r16 LDI r16,HIGH(RAMEND) OUT SPH,r16 ; PORTB und PORTC als Ausgang definieren LDI r16,0b11111111 OUT DDRB,r16 OUT DDRC,r16 ; PORTB und PORTC auf Null setzen LDI r16,0b00000000 OUT ddata,r16 OUT dcmd,r16 ; CE PORTC auf H setzen; PORTC,3; Verbindung zum
in „Grafik LCD Ansteuerung funz nicht??“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Keypad.c
~(1<<PB1) #define Gelb_on PORTB |= (1<<PB2) #define Gelb_off PORTB &= ~(1<<PB2) #define Alarm_on PORTC |= (1<<PC5) #define Alarm_off PORTC &= ~(1<<PC5) #define Blitz_on PORTC |= (1<<PC4) #define Blitz_off PORTC &= ~(1<<PC4) #define Eingang PINC #define Alarm_Kontakt PINC0 #define Gehause_Kontakt PINC3
in „Alarmanlage (Code in Variable)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RSKurzeAuswertung.asm
----------------------------------------------------------------- Anzeigeschleife clrf PORTE clrf PORTC A1 bsf PORTE, 0 ; Segment eins aktiv movf Einer, 0 ; Wert Ziffer 1 laden call BCD ; BCD-Auswertung movwf PORTC ; 7-Segmentanzeige beschreiben call WAIT ; 1ms Warten bcf PORTE, 0 bsf PORTE, 1 movf Zehner, 0 call BCD movwf PORTC call WAIT bcf PORTE, 1 bsf PORTE, 2 movf Hunderter, 0 call BCD movwf PORTC call WAIT bcf PORTE, 2 ; movlw D'128' ; Lade Grenzwert in Akku ; subwf zahl, 0 ; Subtrahiere W von Zahl und Speichere in W
in „PIC nach ändern von Code undefiniertes herumwüten des uC“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RSKurzeAuswertung.asm
----------------------------------------------------------------- Anzeigeschleife clrf PORTE clrf PORTC A1 bsf PORTE, 0 ; Segment eins aktiv movf Einer, 0 ; Wert Ziffer 1 laden call BCD ; BCD-Auswertung movwf PORTC ; 7-Segmentanzeige beschreiben call WAIT ; 1ms Warten bcf PORTE, 0 bsf PORTE, 1 movf Zehner, 0 call BCD movwf PORTC call WAIT bcf PORTE, 1 bsf PORTE, 2 movf Hunderter, 0 call BCD movwf PORTC call WAIT bcf PORTE, 2 ; movlw D'128' ; Lade Grenzwert in Akku ; subwf zahl, 0 ; Subtrahiere W von Zahl und Speichere in W
in „PIC nach ändern von Code undefiniertes herumwüten des uC“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Thermometer_mit_MotorantriebRundanzeige.bas
= 10 'default use 10 for the SW stack $framesize = 40 'default use 40 for the frame space Config Portc = Input 'PortC Eingang für Lichtschranken, Tempsensor Portc.0 = 1 'Pullups einschalten Portc.1 = 1 Portc.2 = 1 Config 1wire = Portc.3 ' DS18S20 on Port C.Pin3 Config Portd = Output 'Port D Ausgang
in „Atmega8 Thermometer mit Schrittmotoranzeige“ · Projekte & Code ·
-
Datei
avr_drehzahl_02.c
char n = 50; while(n--) _delay_ms(1); } void lcd_impuls(void) // Schreibimpuls mit Mindestlaenge { PORTC |= LCD_STROBE; _delay_us(2); PORTC &= ~LCD_STROBE; } void lcd_nibble(char c) // 4-bit-Wert ausgeben { char temp; temp = PORTB & 0xc3; // Datenleitungen an PortB.2 -> PortB.5 temp |= ((c>>2) & 0x3c)
in „einfache Drehzahlmessung mit ATmega88“ · Projekte & Code ·
-
Datei
avr_drehzahl.c
char n = 50; while(n--) _delay_ms(1); } void lcd_impuls(void) // Schreibimpuls mit Mindestlaenge { PORTC |= LCD_STROBE; _delay_us(2); PORTC &= ~LCD_STROBE; } void lcd_nibble(char c) // 4-bit-Wert ausgeben { char temp; temp = PORTB & 0xc3; // Datenleitungen an PortB.2 -> PortB.5 temp |= ((c>>2) & 0x3c)
in „einfache Drehzahlmessung mit ATmega88“ · Projekte & Code ·
-
Datei
avr_drehzahl.c
char n = 50; while(n--) _delay_ms(1); } void lcd_impuls(void) // Schreibimpuls mit Mindestlaenge { PORTC |= LCD_STROBE; _delay_us(2); PORTC &= ~LCD_STROBE; } void lcd_nibble(char c) // 4-bit-Wert ausgeben { char temp; temp = PORTB & 0xc3; // Datenleitungen an PortB.2 -> PortB.5 temp |= ((c>>2) & 0x3c)
in „einfache Drehzahlmessung mit ATmega88“ · Projekte & Code ·
-
Datei
main.c
uint8_t tmp; TCC0.PER += isr_ptr_time[pwm_cnt]; tmp = isr_ptr_mask[pwm_cnt]; if (pwm_cnt == 0) { PORTC.OUT = tmp; // Ports setzen zu Begin der PWM pwm_cnt++; } else { PORTC.OUT &= tmp; // Ports löschen if (pwm_cnt == pwm_cnt_max) { pwm_sync = 1; // Update jetzt möglich pwm_cnt = 0; } else pwm_cnt++;
in „Xmega Soft-PWM“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
empfangen.bas
Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 128 , Noss = 1 Config Spi = Soft , Dout = Portc.0 , Din = Pind.7 , Clock = Portc.1 , Noss = 1 ' werden benötigt für rf12_ready Spi_cs Alias Portc.2 ' SS-Pin Config Spi_cs = Output Spi_sdo Alias Pind.7 ' MISO-PIN Set Spi_cs Clk Alias Portc.1 Mosi Alias Portc.0 'init the spi pins Spiinit ' was so gebraucht wird Dim Count As Byte Dim Temp As Word Dim Rfdata(4) As Byte Waitms 1000 Print "Init" Gosub Rf12_initialize Config Portb.0 = Output Dim I As Integer
in „RFM12 empfängt nur "Müll"“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DisplayFunctions.cpp
###############################################*/ #include "MainHead.h" #define Display_Enable_On PORTC |= (1<<LCD_Enable_PortC7); #define Display_Enable_Off PORTC &= ~(1<<LCD_Enable_PortC7); #define Display_Read PORTB |= (1<<LCD_RW_PortB0); #define Display_Write PORTB &= ~(1<<LCD_RW_PortB0); #define Display_Data PORTC |= (1<<LCD_RS_PortC6); #define Display_Control PORTC &= ~(1<<LCD_RS_PortC6); const uint8_t uCount = 1; char *Text_line; void Display_Blue_Init (void) { //Alle Displayausgänge auf Low stellen Display
in „8-Bit Display Ansteuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
); void init_ADC(void); int16_t Read_ADC(); u16 widerstand_messen(void){ u16 tim=0; DDRC |= 1<<2; PORTC |= 1<<2;//Laden kondensator _delay_ms(200); TIM3_CNT=0; // PORTC &= ~(1<<2); DDRC &= ~(1<<2);//Umschalten auf Messung while(PINC & (1<<2)); tim=TIM3_CNT; return tim; } sub_ir_anwendung(u16 bef){} void
in „Brotbackautomat Steuerplatine defekt“ · Haus & Smart Home ·