-
Datei
main.h
PIND.7 */ #define PIN_BIT7 PIND #define BBIT7 7 /* Ausgang */ #define DDR_BOUT00 DDRC /* Ausgang 0.0 PORTC.5 */ #define PORT_BOUT00 PORTC #define BOUT00 5 #define DDR_BOUT01 DDRC /* Ausgang 0.1 PORTC.4 */ #define PORT_BOUT01 PORTC #define BOUT01 4 #define DDR_BOUT02 DDRC /* Ausgang 0.2 PORTC.3 */ #define PORT_BOUT02 PORTC #define BOUT02 3 #define DDR_BOUT03 DDRC /* Ausgang 0.3 PORTC.2 */ #define PORT_BOUT03 PORTC #define BOUT03 2 #define DDR_BOUT10 DDRC /* Ausgang 1.0 PORTC.1 */ #define PORT_BOUT10 PORTC #define BOUT10
in „8 Bit nach 3x BCD umwandeln“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
RN-Mega_Board.pdf
.4 = 1 Porte.3 = 1 Porte.2 = 1 Porte.1 = 1 Porte.0 = 1 Do 'Blöcke einzeln Portg.0 = 0 Portg.1 = 0 Portc.0 = 0 Portc.1 = 0 Portc.2 = 0 Portc.3 = 0 Portc.4 = 0 Portc.5 = 0 Portc.6 = 0 Portc.7 = 0 Waitms 500 Portg.0 = 1 Portg.1 = 1 Portc.0 = 1 Portc.1 = 1 Portc.2 = 1 Portc.3 = 1 Portc.4 = 1 Portc.5 = 1
in „ATmega2560 spinnt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ledmatrix4.c
für die Datenbits (Zeilen,Spalten) sbi(PORTC,3); //Reset high cbi(PORTC,3); //Reset low sbi(PORTC,4); //Select auf high //In diesen Schleifen werden 2*256 Datenbits eingeschoben for (x = 0; x <16; x++) { //Zeilenschleife, 16 Zeien for (y = 0; y<16; y++) { //eine Zeile = 16 Datenbits if (((x<<4) & (0x01<<y)) != 0) { //wenn Bit gesetzt sbi(PORTC,0); //Rote LED an } else { cbi(PORTC,0); //Rote LED Leitung sicher aus } if (((15-x) & (0x01<<y)) != 0) { //wenn Bit gesetzt sbi(PORTC,1); //Grüne LED an } else { cbi(PORTC,1); //Grüne LED Leitung
in „Programm läuft mit ATMEGA8, nicht jedoch mit AT90S4433“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ac_lcd.bas
------------------------- $regfile = "8535def.dat" $crystal = 8000000 Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , Rs = Portc.0 'These settings are for the AVR-Ctrl in PIN mode Config Lcd = 16 * 2 'configure lcd screen 'other options are 16 * 4 and
in „HD4478 LCD & BASCOM-AVR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
glcdtest.c
void) { // Define data direction of ports outp(0xff, DDRA); outp(0xff, DDRC); // Set Reset -> 0 cbi(PORTC, 6); // Set Reset -> 1 sbi(PORTC, 6); // Initialize controller 1 sbi(PORTC, 3); // Startline -> 0 outp(0xc0, PORTA); // X adress (page) -> 0 outp(0xb8, PORTA); // Y adress -> 0 outp(0x40, PORTA); /
in „GLCD Initialisierungs-Anweisungen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
freqgen.bas
Display initialisieren 'Fuer Lochrasterplatine - weniger Kreuzungen: 'Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.0 , E = Portc.3 , Rs = Portc.5 'Wie im Schaltplan: Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portc.1 , Rs = Portc.0 Config Lcd = 16 * 2 Cursor Off '--------- Tasten abfragen Config Int0 = Low Level Config Int1 = Low Level Portd.2 = 1 Portd.3 = 1 Enable Int0 Enable Int1 On Int0 Increase Nosave 'Portd.2 On Int1
in „Einstellbarer Frequenzgenerator für 0.12 Hz - 8 MHz mit Atmega 8 und Bascom“ · Projekte & Code ·
-
Datei
Lionkap1.asm
abschalten (=0) cbi portd,3 cbi portd,4 sbi portd,0 ;alle Segmente ausschalten (=1) sbi portd,1 in r16,portc ori r16,0x3f out portc,r16 Stellenwahl: cpi r17,1 breq Stelle1 cpi r17,2 breq Stelle2 cpi r17,3 breq Stelle3 Stelle1: ;Vorbereitung Einserstelle, lownibble von r3 mov r30,r3 ;Einser herausmaskieren andi r30,0x0f lpm ;lookup des Segmentmuster für portc in r30,portc ;andre bits von portc mitlesen,werden durch and r30,r0 ;auf 1 gesetzte lookup-bits nicht verändert out portc,r30 ;segmente an portc übereeben mov r30,r3 ; andi r30,0x0f ori r30,0x10 ;offset
in „Multiplexen - 2 Sieben Segment Anzeigen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
STBR005.c
********************************************* // ************ Z1 Fahrt ********************* sbi (PORTC,5); // PC5 Pin 9 Enable motor Current TCNT3H=0x00; // reset TCNT3 high-byte first TCNT3L=0x00; // reset TCNT3 low if(dz1<0) zdir=0 ; else zdir=1; if (zdir) cbi (PORTC,6); else sbi (PORTC,6); // PC6
in „Schrittmotorsteuerung mit Atmega8?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
STBR005.c
********************************************* // ************ Z1 Fahrt ********************* sbi (PORTC,5); // PC5 Pin 9 Enable motor Current TCNT3H=0x00; // reset TCNT3 high-byte first TCNT3L=0x00; // reset TCNT3 low if(dz1<0) zdir=0 ; else zdir=1; if (zdir) cbi (PORTC,6); else sbi (PORTC,6); // PC6
in „Schrittmotoren Programmverlauf abfahren lassen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
STBR005.c
********************************************* // ************ Z1 Fahrt ********************* sbi (PORTC,5); // PC5 Pin 9 Enable motor Current TCNT3H=0x00; // reset TCNT3 high-byte first TCNT3L=0x00; // reset TCNT3 low if(dz1<0) zdir=0 ; else zdir=1; if (zdir) cbi (PORTC,6); else sbi (PORTC,6); // PC6
in „Schrittmotor, Softstart und Timer?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test_CNC.c
Capture, CTC mode } // schnelle ISR für Encoderauswertung ISR (TIMER1_CAPT_vect) { static uint8_t lastPORTC; uint8_t newPORTC = PINC; if ( (newPORTC ^ lastPORTC) & 0x02 && (newPORTC & 0x02) ) { if (newPORTC & 0x01 ) xVAL--; else xVAL++; } if ( (newPORTC ^ lastPORTC) & 0x08 && (newPORTC & 0x08) ) { if (newPORTC & 0x04 ) yVAL--; else yVAL++; } if ( (newPORTC ^ lastPORTC) & 0x20 && (newPORTC & 0x20 ) ) { if (newPORTC & 0x10 ) zVAL--; else zVAL++; } lastPORTC = newPORTC; sync=1; } // langsamer Timer für Zeitbasis LCD Refresh ISR (TIMER0_OVF_vect) { static
in „LCD zu langsam“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
DS1621_Read); Temp = I2C_Read_Data(); I2C_NACK(); I2C_Stop(); peripherie_NoI2C(); peripherie_LED(); PORTC = Temp; for(unsigned long z = 0; z <= 100000; z++){NOP();} if(ACK) { PORTC = 0x0F; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP();} PORTC = 0x0F; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP();} ACK = 0; } else { PORTC = 0xF0; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP(
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
DS1621_Read); Temp = I2C_Read_Data(); I2C_NACK(); I2C_Stop(); peripherie_NoI2C(); peripherie_LED(); PORTC = Temp; for(unsigned long z = 0; z <= 100000; z++){NOP();} if(ACK) { PORTC = 0x0F; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP();} PORTC = 0x0F; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP();} ACK = 0; } else { PORTC = 0xF0; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP(
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
i2clcd.c
lcd_read(mode);// Daten vom i2c Port Expander PORTC=hib;//test lob = lcd_read(mode);// Daten vom i2c Port Expander PORTC=lob;//test PORTC=((hib & 0xF0) + (lob >> 4));//test //return (hib << 4) + (lob & 0x0F);// Original LCD Adresse DB0-7 (incl. BF)
in „4x20-LCD läuft nicht richtig“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Elektoronik.c
<stdbool.h> #include <math.h> #include <util/delay.h> #include <avr/eeprom.h> #define LED_RED (1<<PORTC1) //LED sind low aktiv (LOW um eingeschaltet zu sein) #define LED_GREEN (1<<PORTC2) //LED sind low aktiv (LOW um eingeschaltet zu sein) #define DIGIT_1 (1<<PORTC3) //7-Segementanzeige letzte Digit
in „ATmega8 ADC-Durchschnittsberechnung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Spannungsuberwachung_A16_1.c
} // Timer 0, 1000, 2000, 3000, 4000 // Schalten der Ausgänge // Transistoren if (Akku1 <= Soll) {PORTC |= (1<<PC0);} else {PORTC &= ~(1<<PC0);} if (Akku2 <= Soll) {PORTC |= (1<<PC1);} else {PORTC &= ~(1<<PC1);} if (Akku3 <= Soll) {PORTC |= (1<<PC2);} else {PORTC &= ~(1<<PC2);} if (Akku4 <= Soll) {PORTC |= (1<<PC3);} else {PORTC &= ~(1<<PC3);} if (Akku5 <= Soll) {PORTC |= (1<<PC4);} else {PORTC &= ~(1<<PC4);} if (Akku6 <= Soll) {PORTC |= (1<<PC5);} else {PORTC &= ~(1<<PC5);} if (Akku7 <= Soll) {PORTC |= (1<<PC6);} else {PORTC
in „adc in float in char für display wandeln“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
rohrmotor24-firmware.asm
call get_device_data_by_index movwf var_devicedata_3 movlw .41 movwf var_bits_to_send_counter bsf PORTC, RC5 ; PINDAT high call delay_4118 bcf PORTC, RC5 ; PINDAT low call delay_1006 send_command__loop_bits: decfsz var_bits_to_send_counter, f ; 1 cycle b send_command__get_bit ; 2 cycles b send_command
in „AM oder FM Fernbedinung Rohrmotor -> bild“ · Haus & Smart Home ·
-
Datei
prog.c
************/ PORTD |= (1<<D_OUT1); //relay: Z /************* D_IN1: 12V_L to 0V_L *************/ PORTC |= S0|S1|S2; // H | H | H = Y7 _delay_ms(50); if (!(PINB & (1<<D_IN1))) ERR=+1; PORTC = 0x00; //reset MUX _delay_ms(50); /************* D_IN2: 12V_L to 0V_L *************/ PORTC |= S1|S2; // L | H | H = Y6 _delay_ms(50); if (!(PINB & (1<<D_IN2))) ERR+=1; PORTC = 0x00; //reset MUX _delay_ms(50); /************* D_IN3: 12V_L to 0V_L *************/ PORTC |= S0|S2; // H | L | H = Y5 _delay_ms(50); if (!(PINB & (1<<D_IN3))) ERR+=1; PORTC = 0x00; //reset MUX _delay_ms
in „Berechnungsfehler?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
wait.c
*******/ void rpm_check(void){ if(brightness_pwm){ if((rpm>=max_rpm*12/10)&&(rpm<max_rpm*14/10)){ PORTC |= 0x10; PORTC &= ~(0x60); } else if((rpm>=max_rpm*11/10)&&(rpm<max_rpm*12/10)){ PORTC |= 0x30; PORTC &= ~(0x80); } else if((rpm>=max_rpm)&&(rpm<max_rpm*11/10)){ PORTC |= 0x70; } else{ PORTC &= 0x0f
in „unvorhersehbare effekte beim eeprom beschreiben“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
graphic2.c
Routine, wird ungefähr alle 1000 Take aufgerufen */ SIGNAL(SIG_OVERFLOW2) { u08 gspalte; u08 gtemp; sbi(PORTC,5); //Bright auf high for (gspalte = 0; gspalte<16; gspalte++) { gtemp = gdata[gzeile][gspalte]; //gdata ist volatile, gtemp nicht cbi(PORTC,0); //Rote LED Leitung sicher aus cbi(PORTC,1); //Grüne
in „Optimierung mittels typecast“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PCF-Test-2c.c
###################### void pulse (void) // SCL ist seit i2cstart Ausgang und high (wg. Pullup) { PORTC &= ~(1<<SCL); // SCL low PORTC |= (1<<SCL); // SCL kurz high _delay_ms(1); // 1 ms sicher viel zu lang - funktioniert es trotzdem? PORTC &= ~(1<<SCL); // SCL wieder low return; } void i2cinit (void
in „Software-TWI: enge Clock-Frequenz oder beliebige Zeiten?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Relaisboard.bas
Sub Checkbutton Declare Sub Allon Declare Sub Alloff 'Ausg�nge setzen Config Porta = Output Config Portc = Output Config Pind.7 = Output Portd.7 = 0 Gosub Alloff 'Aliases Kanal A A0 Alias Portc.0 A1 Alias Portc.1 A2 Alias Portc.2 A3 Alias Portc.3 A4 Alias Portc.4 A5 Alias Portc.5 A6 Alias Portc.6 A7 Alias
in „Mega16 arbeitet nur im STK500?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
defines.h
PORTB &=~ (1 << PB1) #define DISPLAY_D4_ON PORTC |= (1 << PC0) #define DISPLAY_D4_OFF PORTC &=~ (1 << PC0) #define DISPLAY_D5_ON PORTC |= (1 << PC1) #define DISPLAY_D5_OFF PORTC &=~ (1 << PC1) #define DISPLAY_D6_ON PORTC |= (1 << PC2) #define DISPLAY_D6_OFF PORTC &=~ (1 << PC2) #define DISPLAY_D7_ON PORTC |= (1 << PC3) #define DISPLAY_D7_OFF PORTC &=~ (1 << PC3) // ************************************************************************** #endif // EOF
in „DOGM081 Display Fehlersuche *HILFE*“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
thermo.cpp
void) { init(); //! Auf verschiedene PORTs aufpassen ! while(1) { PORTE=7; delay100ms(10); PORTD=31; PORTC=255; delay100ms(10); a = PORTA; switch (a) { case 0:PORTD=1;PORTC=50;delay100ms(10);break; case 1:PORTD=2;PORTC=50;delay100ms(10);break; case 2:PORTD=4;PORTC=50;delay100ms(10);break; case 3:PORTD=8;PORTC=50;delay100ms(10);break; case 4:PORTD=16;PORTC=50;delay100ms(10);break; case 5:PORTD=3;PORTC=50;delay100ms(10);break; case 6:PORTD=7;PORTC=50;delay100ms(10);break; case 7:PORTD=15;PORTC=50;delay100ms
in „PORTA als analoger Input (PIC16F887)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
thermo.cpp
void) { init(); //! Auf verschiedene PORTs aufpassen ! while(1) { PORTE=7; delay100ms(10); PORTD=31; PORTC=255; delay100ms(10); PORTA = a; switch (a) { case 0:PORTD=1;PORTC=50;delay100ms(10);break; case 1:PORTD=2;PORTC=50;delay100ms(10);break; case 2:PORTD=4;PORTC=50;delay100ms(10);break; case 3:PORTD=8;PORTC=50;delay100ms(10);break; case 4:PORTD=16;PORTC=50;delay100ms(10);break; case 5:PORTD=3;PORTC=50;delay100ms(10);break; case 6:PORTD=7;PORTC=50;delay100ms(10);break; case 7:PORTD=15;PORTC=50;delay100ms
in „PORTA als analoger Input (PIC16F887)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Elektoronik.c
interrupt.h> #define F_CPU 6000000UL //Quarzansteuerung #include <util/delay.h> #define LED_RED (1<<PORTC1) //LED sind low aktiv (LOW um eingeschaltet zu sein) #define LED_GREEN (1<<PORTC2) //LED sind low aktiv (LOW um eingeschaltet zu sein) #define DIGIT_1 (1<<PORTC3) //7-Segementanzeige letzte Digit
in „ATmega8 ADC-Durchschnittsberechnung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
EncoderCounterAVR.cpp
.2 to one as output DDRC |= _BV(3); // set PORTC.3 to one as output DDRC |= _BV(4); // set PORTC.4 to one as output DDRC |= _BV(5); // set PORTC.5 to one as output DDRC |= _BV(6); // set PORTC.6 to one as output DDRC |= _BV(7); // set PORTC.7 to
in „maximale Xilinx CPLD clock Frequenz“ · FPGA, VHDL & Co. ·
-
Datei
Led_zeitverzoegert.txt
determined factor 8 MHz while(x--); } } while(1) { if (PINB & (1 << PB0))//wenn PB0 High ist... { PORTC |= (1 << PC0); //PC0 High del_ms(1024); } if (PINB & (1 << PB1))//wenn PB1 High ist... { PORTC |= (1 << PC1); //PC1 High del_ms(1024); } if (PINC & (1 << PC2))//wenn PC2 High ist... { PORTC |= (1 << PC0); //PC0 High del_ms(1024); } if (PINC & (1 << PC3))//wenn PC3 High ist... { PORTC |= (1 << PC1); //PC1 High del_ms(1024); } // Eine Schleife if (!(PINB & (1 << PB0))) //wenn PB0 Low ist... { PORTC &= ~(1 << PC0); //PC0 Low } if (!(PINB & (1 << PB1))) //wenn PB1 Low ist... { PORTC
in „Nachlaufsteuerung mit Taster“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ADC.asm
DDRD, temp1 ldi temp1, (1<<CLK | 1<<CS) ; Port C out DDRC, temp1 ldi temp1, (1<<CS) ; CS=HIGH out PORTC, temp1 rcall lcd_init ; Display initialisieren rcall lcd_clear ; Display löschen Main: ldi temp1, (0<<CS) ; CS=LOW BEGINN out PORTC, temp1 rcall wait18 sbi PORTC, CLK ; CKL 1 rcall wait18 cbi PORTC, CLK rcall wait18 sbi PORTC, CLK ; CKL 2 rcall wait18 cbi PORTC, CLK rcall wait18 sbi PORTC, CLK ; CKL 3 (NULL Bit) rcall wait18 cbi PORTC, CLK rcall wait18 ldi temp3, 12 ; Bitzähler schleife: lsl temp2 ; Daten weiterschieben
in „LTC1286 --> AVR --> Software SPI“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
taster.c
) #define Taster4_Down !(PIND&(1<<PD6)) #define Taster5_Down !(PIND&(1<<PD7)) #define Kanal1_HIGH PORTC |= (1<<PC0) #define Kanal2_HIGH PORTC |= (1<<PC1) #define Kanal3_HIGH PORTC |= (1<<PC2) #define Kanal4_HIGH PORTC |= (1<<PC3) #define Kanal5_HIGH PORTC |= (1<<PC5) #define Kanal1_LOW PORTC &= ~(1<<PC0) #define Kanal2_LOW PORTC &= ~(1<<PC1) #define Kanal3_LOW PORTC &= ~(1<<PC2) #define Kanal4_LOW PORTC &= ~(1<<PC3) #define Kanal5_LOW PORTC &= ~(1<<PC5) uint8_t encode(void) { if (Taster1_Down) return 1; if (Taster2_Down) return
in „Wie am besten meine Taster Verriegeln ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
timer16_ExtInt-count_Leds_test.c
(255); // led outputs 0-3 to be controlled inverted: 0 = led on, 1 = off PORTC &= ~(1<<LED_bit1); _delay_ms(255); PORTC &= ~(1<<LED_bit2); _delay_ms(255); PORTC &= ~(1<<LED_bit3); _delay_ms(235); PORTD &= ~(1 << LED_red); // led_r aus PORTC |= (1<<LED_bit0) | (1<<LED_bit1) |
in „ATMEGA88/168 - timer1 OVF bringt reset“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Neues_Textdokument.txt
//DA4-DA7 PORTC 0-3 //RS PORTC 6 //E PORTC 7 void lcd_ini () { DDRC = 0xCF; // setze Portrichtung (1 = Ausgang): 0011 1111 PORTC=0x00; // alle Leitungen LOW delay(10000); // 10ms warten bis LCD wirklich bereit (max
in „Probleme bei ansteuerung von LCD über verschiedene PORTs-Pin“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
rand.txt
Initialisierungen int zufall=rand()%7; //Zufallszahl 1-7 while (true) // Mainloop-Begin { if(zufall==1){ PORTC=0b00000001; long_delay(1000);} if(zufall==2){ PORTC=0b00000010; long_delay(1000);} if(zufall==3){ PORTC=0b000000011; long_delay(1000);} if(zufall==4){ PORTC=0b000000110; long_delay(1000);} if(zufall==5){ PORTC=0b000000101; long_delay(1000);} if(zufall==6){ PORTC=0b000000111; long_delay(1000);} if(zufall==7){ PORTC=0b000000000; long_delay(1000);} } // Mainloop-Ende } //------------------------------------
in „LEDS per Zufall ein- u auschalten“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
blink.c
outer2 = 1000; while (outer2) { while ( ms ) ms--; outer2--; } outer1--; } } void sendClock () { cbi(PORTC,PC7); sbi(PORTC,PC7); } void sendStrobe () { sbi(PORTC,PC4); cbi(PORTC,PC4); } int testBit(unsigned char val, int bit) { unsigned char test_val = 0x01; /* dezimal 1 / binär 0000 0001 */ /* Bit an entsprechende
in „Probleme mit Variablenplatz/Arrays“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
freqgen.bas
Display initialisieren 'Fuer Lochrasterplatine - weniger Kreuzungen: 'Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.0 , E = Portc.3 , Rs = Portc.5 'Wie im Schaltplan: Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portc.1 , Rs = Portc.0 Config Lcd = 16 * 2 Cursor Off '--------- Tasten abfragen Config Int0 = Low Level Config Int1 = Low Level Portd.2 = 1 Portd.3 = 1 Enable Int0 Enable Int1 On Int0 Increase Nosave 'Portd.2 On Int1
in „Einstellbarer Frequenzgenerator für 0.12 Hz - 8 MHz mit Atmega 8 und Bascom“ · Projekte & Code ·
-
Datei
freqgen.bas
Display initialisieren 'Fuer Lochrasterplatine - weniger Kreuzungen: 'Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.0 , E = Portc.3 , Rs = Portc.5 'Wie im Schaltplan: Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portc.1 , Rs = Portc.0 Config Lcd = 16 * 2 Cursor Off '--------- Tasten abfragen Config Int0 = Low Level Config Int1 = Low Level Portd.2 = 1 Portd.3 = 1 Enable Int0 Enable Int1 On Int0 Increase Nosave 'Portd.2 On Int1
in „Einstellbarer Frequenzgenerator für 0.12 Hz - 8 MHz mit Atmega 8 und Bascom“ · Projekte & Code ·
-
Datei
Werkzuegwechsler.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
in „Bräuchte hilfe bei der Programmierung eines Atmega 32“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Werkzuegwechsler.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
in „Bräuchte hilfe bei der Programmierung eines Atmega 32“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
testaufbau.asm
**; INIT_LCD bsf STATUS, RP0 ; Bankwechsel zu Bank1 movlw B'00000000' movwf TRISC ; Alle Pins von PortC I/O bcf STATUS, RP0 ; Bank 0 clrf PORTC ; Alle Pins von PortC als Ausgänge bcf RW ; LCD Steuerleitungen auf definierten Zustand bringen bcf RS ; --------------------" "------------------------- bcf
in „LCD am PIC 16F877“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
USBLEDTEST.c
unsigned char var; DDRC=(1<<PC1)|(1<<PC2); DDRD = ~(1 << 2); uchar i; LEDH=0; LEDL=0; odDebugInit(); PORTC =(1<<PC1); for (i=1;i<20;i++) { _delay_ms(100); } var=(1<<PC1); var=~var; PORTC= PORTC & var; usbInit(); PORTC=(1<<PC2); for (i=1;i<20;i++) { _delay_ms(100); } usbDeviceDisconnect(); /* enforce re-enumeration
in „Atmega168 und vusb“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
tagezaehler.bas
Wert Case 0 'gfedcba Portb = &B00000000 '0 Case 1 Portb = &B00111001 '1 Case 2 Portb = &B01100100 Portc.4 = 0 '2 Case 3 Portb = &B00110000 '3 Portc.4 = 0 Case 4 Portb = &B00011001 '4 Portc.4 = 0 Case 5 Portb = &B00010010 '5 Portc.4 = 0 Case 6 Portb = &B00000010 '6 Portc.4 = 0 Case 7 Portb = &B00111000 '7 Case 8 Portb = &B00000000 '8 Portc.4 = 0 Case 9 Portb = &B00010000 '9 Portc.4 = 0 Case Else Portb = &B00111111 Portc.4 = 1 'Anzeige Dunkel Schalten End Select Return
in „Jumbo-LED-Anzeige beschalten“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
; z++){NOP();} PORTC = 0x0F; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP();} ACK = 0; } else { PORTC = 0xF0; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP();} PORTC = 0xF0; for(unsigned long z = 0; z <= 4000; z++){NOP();} PORTC = 0x00; for(unsigned long z = 0; z <= 2000; z++){NOP();} } peripherie_NoLED
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
display_lib.h
LCD_CS PIN3 // Chip Select #define LCD_RES PIN2 // RESET // macros for control lines #define CLR_RS PORTC.OUT &= ~(1<<LCD_RS); #define SET_RS PORTC.OUT |= (1<<LCD_RS); #define CLR_CS PORTC.OUT &= ~(1<<LCD_CS); #define SET_CS PORTC.OUT |= (1<<LCD_CS); #define CLR_RESET PORTC.OUT &= ~(1<<LCD_RES); #define SET_RESET PORTC.OUT |= (1<<LCD_RES); #define CLR_WR PORTC.OUT &= ~(1 << LCD_WR); #define SET_WR PORTC.OUT |= (1 << LCD_WR); #define CLR_RD PORTC.OUT &= ~(1 << LCD_RD); #define SET_RD PORTC.OUT |= (1 << LCD_RD); #define
-
Datei
thermo3.asm
********************************** ORG 0x000 goto confports confports: CLRF PORTA CLRF PORTB CLRF PORTC BSF STATUS, RP0 MOVLW 0x0FF MOVWF TRISA MOVLW 0x000 MOVWF TRISB BSF OPTION_REG, NOT_RBPU MOVLW 0x01F MOVWF TRISC BCF STATUS, RP0 GOTO MAIN MAIN: LCDINIT: CLRF PORTC CALL MEGDELAY CALL MEGDELAY CALL
in „ad-wert ausgabe an lcd“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Elektoronik.c
interrupt.h> #define F_CPU 6000000UL //Quarzansteuerung #include <util/delay.h> #define LED_RED (1<<PORTC1) //LED sind low aktiv (LOW um eingeschaltet zu sein) #define LED_GREEN (1<<PORTC2) //LED sind low aktiv (LOW um eingeschaltet zu sein) #define DIGIT_1 (1<<PORTC3) //7-Segementanzeige letzte Digit
in „ATmega8 ADC-Durchschnittsberechnung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd-display.c
void gotozeile(uint8_t zeile) { uint8_t ziel=zeile; out_w_1_0_0; // RS if(ziel==1) { //Cursor home PORTC = 0x02;out_w_1_1_0;_delay_ms(1);out_w_1_1_1; } if(ziel==2) { //Cursor home PORTC = 0x02;out_w_1_1_0;_delay_ms(1);out_w_1_1_1; //Cursor shift um 40 Zeichen for(uint8_t i=0; i<40; i++) { PORTC = 0x14;out_w_1_1_0;_delay_ms(1);out_w_1_1_1; } } if(ziel==3) { //Cursor home PORTC = 0x02;out_w_1_2_0;_delay_ms(1);out_w_1_2_1; } /*unterhalb okay*/ if(ziel==4) { //Cursor home PORTC = 0x02;out_w_1_2_0;_delay_ms(1);out_w_1_2_1; //Cursor shift um 40 Zeichen for(uint8_t i=0; i<40;
in „Probleme mit dem Variablenformat uint8_t“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sd.asm
CMD1 senden (max 10 Mal dann Timeout) error_cmd0: ;Abfrage auf FF in sd_ret_byte ldi lcdbuf, 127 out PORTC,lcdbuf rcall DELAY0 ldi lcdbuf, 255 out PORTC,lcdbuf ret error_cmd1: ;Abfrage auf FF in sd_ret_byte ldi lcdbuf, 127 out PORTC,lcdbuf rcall DELAY0 ldi lcdbuf, 255 out PORTC,lcdbuf ret end_init: ; Bei
-
Datei
pinoperations.c
<pin); break; case 2: PORTC = PORTC & ~(1<<pin); break; case 3: PORTD = PORTD & ~(1<<pin); break; } } inline void toggleOutput(u8 port, u8 pin) { switch (port) { case 0: PORTA = PORTA ^ 1<<pin; break; case 1: PORTB = PORTB ^ 1<<pin; break; case 2: PORTC = PORTC ^ 1<<pin; break; case 3: PORTD = PORTD ^ 1<<pin; break; } } inline u8 getInput(u8 port, u8 pin) { switch (port) { case 0: return PINA & 1<<pin; case 1: return PINB & 1<<pin; case 2: return
in „genauer Code im Anhang“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sd.asm
CMD1 senden (max 10 Mal dann Timeout) error_cmd0: ;Abfrage auf FF in sd_ret_byte ldi lcdbuf, 127 out PORTC,lcdbuf rcall DELAY0 ldi lcdbuf, 255 out PORTC,lcdbuf ret error_cmd1: ;Abfrage auf FF in sd_ret_byte ldi lcdbuf, 127 out PORTC,lcdbuf rcall DELAY0 ldi lcdbuf, 255 out PORTC,lcdbuf ret end_init: ; Bei
in „SD-Karten Ansteuerung über SPI liefert keine Antwort“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd.asm
ret lcd_enable: sbi PORTD, PD6 rcall wait2 cbi PORTD, PD6 ret init_lcd: ldi temp, 0b00000010 out PORTC, temp rcall lcd_enable ldi temp, 0b11110000 out PORTC, temp rcall lcd_enable swap temp out PORTC, temp rcall lcd_enable ldi temp, 0b00010000 out PORTC, temp rcall lcd_enable swap temp out PORTC, temp rcall lcd_enable ret lcd_write: sbi PORTD, PD4 swap zeichen out PORTC, zeichen rcall lcd_enable swap zeichen out PORTC, zeichen rcall lcd_enable cbi PORTD, PD4 ret lcd_clear: ldi temp, 0b00010000 out PORTC, temp rcall lcd_enable swap temp out PORTC, temp rcall lcd_enable
in „UART Bootloader ATtiny13 - ATmega644“ · Projekte & Code ·