-
Datei
TastaturDigivoice.c
Taste_entprellt; } void Signal_an_Digivoice (unsigned char Signal) { uint32_t Signal_Zeit=0; if (Signal==1) { PORTC |= (1<<PC1); Signal_Zeit=Zeit; while (Signal_Zeit+135>Zeit) {wdt_reset();} PORTC &= ~(1<<PC1);} if (Signal==2) {PORTD |= (1<<PD0); Signal_Zeit=Zeit; while (Signal_Zeit+135>Zeit) {wdt_reset();} PORTD
in „Tastendrücke und Portbits“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD_asm10.s
8bit i/f cLCDfunct2 = 0x20 ; 4bit i/f, 2lines cLCDsetcga = 0x40 ; cLCDsetdda = 0x80 ; ; ; LCD_rs_ = (PORTC<<8) + 1 LCD_rsd_ = (DDRC<<8) + 1 LCD_e_ = (PORTC<<8) + 3 LCD_ed_ = (DDRC<<8) + 3 LCD_wr_ = (PORTC<<8) + 2 LCD_wrd_ = (DDRC<<8) + 2 ; LCDdout = PORTC LCDdin = PINC LCDddr = DDRC ; ;-----------------
in „Character LCD für AVRs mit 4bit Bus“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Beispiel.c
1<<PF7); // Gasventil zu PORTA &= ~(1<<PA1); // Kerze aus PORTJ &= ~(1<<PJ7); // Kerosinventil zu PORTC &= ~(1<<PC6); // Starter aus DDRD &= ~(1<<PD0); // Taster "Start" und "Autostop" auf Eingang definiert DDRE &= ~(1<<PE4); PORTD |= (1<<PD0); // Pull up aktiviert für Taster "Start" und "Autostop" PORTE
in „String Ausgabe löst Reset aus“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
#define D6 PD6 #define D7 PD7 */ // #define cs_set_low PORTB &= ~(1<<DDB2); // #define a0_set_low PORTC &= ~(1<<DDC0); void SPI_init(){ DDRB = (1<<DDB3) | (1<<DDB5) | (1<<DDB2) | (1<<DDB0); //MOSI, SCK, SS, Reset DDRB &= ~(1<<DDB4); //MISO as Input DDRC |= (1<<DDC0); //turn Vcc as Output to supply display
in „TFT_ILI9163C mit Arduino richtig verbinden“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
hal.c
~(1<<IN3SV); IN3PORT |= (1<<IN3SV); IN4DDR &= ~(1<<IN4SV); IN4PORT |= (1<<IN4SV); PORTB = portB; PORTC = portC; PORTD = portD; DDRB = ddrB; DDRC = ddrC; DDRD = ddrD; return; } void initTimer() { // Prescaler : 20MHz / 20000kHz TimerAufrufe = 1000 / PreScaler 8 = 250 TCCR0A = (1<<WGM01); TCCR0B = (1<
in „C++ auf einem MC, wie geht das?“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
BT_AVR_Studio_6_1.pdf
zu lesen. Bei einigen Fehlermel- dungen hilft das AVR Studio 6 auch bei der Fehlersuche. Fehler: PORTC in PORTc geändert In diesem Programmaus- schnitt habe ich einen Fehler provoziert. Ich Zeile 16 habe dazu in der Zeile 16 den Eintrag PORTC in PORTc geändert. Ist nur eine kleine Ände- rung, bewirkt
in „Programm auf µC laden“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD_test.c
=~ (1<<RS); if(rw == 1) PORTD |= (1<<RW); else PORTD &=~ (1<<RW); uint8_t upper = (bitmuster>>4); PORTC = upper; PORTD |= (1<<e); _delay_ms(1); PORTD &=~ (1<<e); } void set8bit(uint8_t rs,uint8_t rw,uint8_t bitmuster) { if(rs == 1) PORTD |= (1<<RS); else PORTD &=~ (1<<RS); if(rw == 1) PORTD |= (1<<RW); else PORTD &=~ (1<<RW); uint8_t upper = (bitmuster>>4); PORTC = upper; PORTD |= (1<<e); _delay_ms(1); PORTD &=~ (1<<e); uint8_t lower = bitmuster; PORTC = lower; PORTD |= (1<<e); _delay_ms(1); PORTD &=~ (1<<e); } int main(void) { DDRD = 0xFF; DDRC = 0xFF; _delay_ms
in „LCD Ansteuerung - Fehlersuche“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
index.c
Ausgänge definieren DDRD = 0xff; //Alle Pins auf C als Ausgänge definieren // Ausgänge auf LOW setzen PORTC = 0x00; //Alle Pins auf B auf LOW setzen PORTD = 0x00; //Alle Pins auf C auf LOW setzen uart_puts ("Initalisierung erfolgreich\n\n"); //Zum Debuggen char ba[5]; uart_gets (ba,10); PORTC |= (1 << PC2); //Drehrichtung einstellen PORTC |= (0 << PC3); // " " while(1) { OCR1A = atoi(ba); OCR1B = atoi(ba); } } /* ------------------------------------------------------------------------------------------------------ Roboter Motor Treiber
in „ATMega 32 stürzt ab“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
index.c
Ausgänge definieren DDRD = 0xff; //Alle Pins auf C als Ausgänge definieren // Ausgänge auf LOW setzen PORTC = 0x00; //Alle Pins auf B auf LOW setzen PORTD = 0x00; //Alle Pins auf C auf LOW setzen uart_puts ("Initalisierung erfolgreich\n\n"); //Zum Debuggen char ba[5]; uart_gets (ba,10); PORTC |= (1 << PC2); //Drehrichtung einstellen PORTC |= (0 << PC3); // " " while(1) { OCR1A = atoi(ba); OCR1B = atoi(ba); } } /* ------------------------------------------------------------------------------------------------------ Roboter Motor Treiber
in „ATMega 32 stürzt ab“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
stoppuhr.c
Initialisierung //***************** DDRB = 0xFF; //PORTB auf Ausgang setzen 7-Segmente DDRC = 0xFF; //PORTC auf Ausgang für Segmentwahl PORTB = 0b00010001; //Initialwert für Ausgang //Interrupt konfigurieren MCUCR = (1<<ISC01); //Int0 auf fallende Flanke konfigurieren GICR = (1<<INT0); //Int0 aktivieren
in „AVR-Stoppuhr zählt nur bis 255“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
feuchtigkeit2.asm
out PORTB, r16 ldi r16, 0xFF ; Port D (LEDs) als Ausgang out DDRC, r16 ldi r16, 0xff ; LEDs aus out PORTC, r16 ldi r16, 0 ; Timer zurücksetzen out TCNT1L, r16 out TCNT1H, r16 ; ZPointer auf Array-Anfang setzen ldi r30, LOW(array) ldi r31, HIGH(array) ldi r22, 0 sei ;64 Werte in den RAm schreiben: ram_fill
in „Seltsame Messwerte bei Feuchtigkeitssensor“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RFM12_ultimate_senden_V7.bas
$regfile = "m32def.dat" $hwstack = 32 $swstack = 10 $framesize = 40 $crystal = 1000000 Nsel Alias Portc.1 Sdi Alias Portc.3 Sdo Alias Pinc.7 Sck Alias Portc.2 Dim I As Byte Dim X As Byte Dim D As Word Dim Data_out(10) As Byte Declare Sub Wait_rfm12 Declare Sub Spi16 Config Nsel = Output Config Sdi =
in „RFM12 an langsamen Mikrocontroller(1MHz)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
<COM1A1) | (0<<WGM11); // GLSCK deaktivieren // Standard setzten PORTB &= ~(1<<PB2); // BLANK LOW PORTC &= ~(1<<PC4); // XLAT LOW // PWM stoppen PORTB |= (1<<PB2); // BLANK HIGH // Daten übetragen SPDR = 240; while (!(SPSR & (1<<SPIF))); SPDR = 240; while (!(SPSR & (1<<SPIF))); SPDR = 240; while (!(SPSR
in „TLC5940 - Schema für Ansteuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
servo_uart.c
Timer Overflow Interrupt aktiv TCNT2 = 6; //Lade Timer2 für 1ms DDRC |= (1<<PC3); //PINA0 = Ausgang PORTC &= ~(1<<PC3); SERVO_POSITION = 100; //von 0 bis 250 Angebe uart_init(); while(1) { print_string(text); input_string(puffer); print_char(13);print_char(10); SERVO_POSITION = atoi(puffer); print_string
in „Servo am Mikrocontroller“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test_code.txt
0000 NOP 13 0018 D7F3 BRA 0x0 14 001A FFFF NOP 15 001C 9C94 BCF TRISC, 6, ACCESS 16 001E 9C82 BCF PORTC, 6, ACCESS 17 0020 8C82 BSF PORTC, 6, ACCESS 18 0022 0E0D MOVLW 0xD 19 0024 6E0B MOVWF 0xB, ACCESS 20 0026 0EAF MOVLW 0xAF 21 0028 6E0C MOVWF 0xC, ACCESS 22 002A 0EB6 MOVLW 0xB6 23 002C 6E0D MOVWF
in „Pic 18f4525 läuft nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Master_Reciever.ino
#include <util/twi.h> int main(){ init(); Serial.begin(9600); uint8_t Tank_Status; PORTC |= (1 << PORTC4) | (1 << PORTC5); //analog Input 4 & 5 mit Pull-up-Widerstand auf High ziehen (PC4, PC5) TWBR = 72; // Übertragungsgeschwindigkeit festlegegen while(1){ delay(1000); //Start Senden
in „Arduino I2C Hardware Register Adressen im MR-ST“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
HSYNC for VSYNC if (linecount > 305 && linecount < 309) { //Make here vertical syncronization sbi(PORTC,0); //inverted syncro level on char i = 15; while (--i) { NOP;} //And "black" = 8 mksk; cbi(PORTC,0); //inverted syncro level off } else { //Make HSYHC = 4 mksk; cbi(PORTC,0); //syncro level on char i = 30; while (--i) { NOP;} //And "black" = 8 mksk; sbi(PORTC,0); //syncro level off } video_enable_flg = true; if ((linecount < 40) || (linecount > 278)) { video_enable_flg = false; //Add to avoid flickering at top display NOP; NOP; NOP; NOP; NOP; NOP; NOP;
in „Simple VGA/Video adapter“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Kuehlschrankplatine_12.bas.txt
framesize = 50 $crystal = 5120000 'Quartzoszillator 'Display-Konfiguration Config Lcdpin = Pin , Db4 = Portc.1 , Db5 = Portc.2 , Db6 = Portc.3 , Db7 = Portc.4 , E = Portc.5 , Rs = Portd.0 Config Lcd = 16 * 2 'Display-Typ Dim Ee_startzaehler As Eram Integer 'Neustarts kontrollieren. Eram ist ein EEprom-Wert
in „unzuverlässiger Temperaturregler“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
iom324pb.h
DDC1 1 #define DDRC0 0 // Inserted "DDC0" from "DDRC0" due to compatibility #define DDC0 0 #define PORTC _SFR_IO8(0x08) #define PORTC7 7 #define PORTC6 6 #define PORTC5 5 #define PORTC4 4 #define PORTC3 3 #define PORTC2 2 #define PORTC1 1 #define PORTC0 0 #define PIND _SFR_IO8(0x09) #define PIND7 7 #define
in „ATMega324PB: Header?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RFM12_ultimate_empfangen_V7.bas
in D Dim Data_in(10) As Byte 'Speicher für die 10 zu lesenden bytes Declare Sub Spi16 Nsel Alias Portc.1 '4 beliebige Pins am AVR, da kein Hardware SPI verwendet wird Sdi Alias Portc.3 Sdo Alias Pinc.7 Sck Alias Portc.2 Config Nsel = Output Config Sdi = Output Config Sck = Output Print "init" 'Kontrolle
in „RFM12 an langsamen Mikrocontroller(1MHz)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
unsigned char i = 0; str[i] != 0; ++i) lcd_data(str[i]); } int main() { DDRC = 0x07; //Für Debug-LED PORTC = 0x00; //Für Debug-LED LCD_DDR = 0xff; //Für LCD LCD_PORT = 0x00; //Für LCD lcd_init(); LCD_PORT = 0x00; char c = 'A'; while(1) { lcd_clear(); lcd_data(c); ++c; PORTC ^= 0x01; long_delay(1000); lcd_clear(); lcd_data(c); ++c; PORTC |= 0x01; long_delay(1000); } return 0; }
in „Auf LCD nur Buchstaben A-N“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Variante1.asm
zaehler, 0x00 ; Zähler löschen ldi timer, 0x00 ; Timer löschen out PORTD, temp ; PORTD löschen out PORTC, temp ; PORTC löschen clr null anfang: cli ; Globalen Interrupt ausschalten ; in temp, PINb ; Port B einlesen sbic Pinb,0 ;Überspringe wenn PinB0=0 rjmp hochzaehlen ; andi temp, 1 ; mit 1 ver-unden
in „Assembler-Kode Optimierung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
& PWRTEN); __CONFIG(XT & WDTDIS & UNPROTECT ); void main(void){ TRISA = 0; PORTD = 0; TRISD = 0; PORTC = 0; TRISC = 0; lcd_init(); lcd_clear(); lcd_puts("hello"); while(1){ //testing only -> LED Blinking RA0 = 1; DelayMs(10); RA0 = 0; DelayMs(500); } } /* * LCD interface example * Uses routines from
in „LCD_4Bit_PIC_Init“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
& PWRTEN); __CONFIG(XT & WDTDIS & UNPROTECT ); void main(void){ TRISA = 0; PORTD = 0; TRISD = 0; PORTC = 0; TRISC = 0; lcd_init(); lcd_clear(); lcd_puts("hello"); while(1){ //testing only -> LED Blinking RA0 = 1; DelayMs(50); RA0 = 0; DelayS(10); } } /* * LCD interface example * Uses routines from delay.c
in „LCD_4Bit_PIC_Init“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TLC.h
Steuerleitungen des TLC. //Müssen erst an die Hardware angepasst werden. #define OE_PIN 0 #define OE_PORT PORTC #define OE_DDR DDRC #define LE_PIN 1 #define LE_PORT PORTC #define LE_DDR DDRC #define LE_PIN 1 #define LE_PORT PORTC #define LE_DDR DDRC #define CSEL4_PIN 2 #define CSEL4_PORT PORTB #define CSEL4_
in „BC517 zu langsam für Matrix?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.h
PWM_AUS PORTB &= ~(1<<PB1); #define PWM_STATUS (PINB && (1<<PB1)) #define NULL_A_DDR DDRC &= ~(1<<PC0); PORTC &= ~(1<<PC0); #define NULL_B_DDR DDRC &= ~(1<<PC1); PORTC &= ~(1<<PC1); #define NULL_C_DDR DDRC &= ~(1<<PC2); PORTC &= ~(1<<PC2); #define MITTEL_DDR DDRD &= ~(1<<PD6); PORTD &= ~(1<<PD6); /////////
in „Brushless-Regler: Umschaltung Analog Komparator <-> ADC“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
auswertung.c
Entprellung hochzählen } else{ *piPL = 0; } if (*piPL == 50) { // Entprellung für Parallel-load Empfänger PORTC &= ~(1<<PC2); // PortC Pin2 auf low = Parallel-load EMPFÄNGER *piPL = 0; // Zähler für Entprellung wieder zurücksetzen } else{ return; } *pLV1 = ~*pLV1; // Komplement bilden 1 -> 0 *pLV2 = ~*pLV2;
in „AtMega 32 - LCD-Anzeige fällt ab“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Audio_Video_Box.asm
Rest als Eingang out DDRB, r16 ser r16 out PORTB, r16 clr r16 out PORTA, r16 ldi r16, 0b00110000 out PORTC, r16 rcall lcd_enable rcall delay5ms ldi r16, 0b00001100 out PORTC, r16 rcall lcd_enable rcall delay5ms ldi r16, 0b00000001 out PORTC, r16 rcall lcd_enable rcall delay5ms ldi r16, 0b00000110 out PORTC
-
Datei
Strichbreite25.bas
.7 = 1 'Delta_Frequenz Alias Pind.7 Config Portb.0 = Output 'Umschaltung Sweep Hold 1=1ms 'Config Portc.2 = Input 'erweiterung Vers.10 'Portc.2 = 0 'erweiterung Vers.10 'Marke1_aus Alias Pinc.2 'erweiterung Vers.10 Config Portc.3 = Input 'erweiterung Vers.10 Portc.3 = 0 'erweiterung Vers.10 Marke2_aus
in „mit Bascom über rs232 Frequenz aus einen Frequenzzählermodul auslesen.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Regenbogen_atmega88.bas
initialisieren######################################################### Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portd.7 , Rs = Portd.4 Initlcd Cursor Off Cls Locate 1 , 1 Lcd "R" Locate 1 , 5 Lcd "G" Locate 1 , 9 Lcd "B" Locate 1 , 13 Lcd "Y" Locate 2 ,
in „led blinkt obwohl sie es nicht soll :-(“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
switch.c
PORTD #define RLED_PORTPIN4 PD4 //Blaue LEDs //Blaue LED 1 #define BLED_DDR DDRC #define BLED_PORT PORTC #define BLED_PORTPIN PC1 //Blaue LED 2 #define BLED_DDR2 DDRC #define BLED_PORT2 PORTC #define BLED_PORTPIN2 PC2 //Blaue LED 3 #define BLED_DDR3 DDRC #define BLED_PORT3 PORTC #define BLED_PORTPIN3 PC3 //Blaue LED 4 #define BLED_DDR4 DDRC #define BLED_PORT4 PORTC #define BLED_PORTPIN4 PC4 volatile uint8_t key_state; // debounced and inverted key state: // bit = 1: key pressed volatile uint8_t key_press; // key press detect volatile uint8_t key_rpt; // key long
in „LED Lightshow mit verschiedenen Programmen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
simply_off_state.c
mehr erlauben TIMSK |= (1<<TOIE1); // Interrupt für Timer1 wieder zulassen status = Initialisierung; PORTC &= ~(1<<PC4); // Einschaltsignal } else { //Wenn "nein", wieder auf neuen Impuls warten TCCR1B = ((1<<CS12)|(1<<CS10));//Timer einschalten Durchlauf_F = False; // Merker zurücksetzen sleep_mode(); } } break; case Offset: // Offset- Messung muss im ausgeschalteten zustand gemacht werden PORTC |= (1<<PC4); // Abschaltsignal for (index=0; index<5; index++) vWait_Timer0(); Leistung_offset = 20*ADU_Wert-(ADU_Wert*LST_MULT)/LST_DIV; PORTC &= ~(1<<PC4); // Einschaltsignal status = Initialisierung
in „Stromsparen und Atmega8?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
KUB.c
------------------------------------------------------------------------- SIGNAL(SIG_OVERFLOW1) { PORTC |= ( 1 << PC3); TCNT1 = timer; uart_send(0x0D); //CR uart_send_string("V;"); //--------------------------------------------------------------------------------------------------- // 1. voltage value
in „OVERFLOW Zeitmessung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Mega8_test2.asm
aktivieren sei ; Interrupts global aktivieren ; Ports Initalisieren ldi r16,0xFF out DDRC,r16 out PORTC,r16 ; Menüregister einstellen, 00 mache nichts, 49 Untermenü1, 50 Untermenü2 usw. ldi r22,48 ; 48 Gehe ins Hauptmenü ldi r21,0 rjmp main mh: ldi r22,0 rcall m_titel ldi zl,low(s_mh0*2); ldi zh,high
in „Menü rs232 wie macht man so was besser?“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
CountDown.pdf
ldi Temp , 0b00111100 ; D.2 bis D.5 = Pullup out PORTD , Temp ; ldi Temp , 0b00000000 ; PORTB und PORTC: Alle Bits = 0 out PORTB , Temp ; out PORTC , Temp ; ;---------------------------------------------------------------------------------------------------------- ; Variable initialisieren ldi Temp ,
in „CountDown Zeitschalter ATMEGA8A Assembler“ · Projekte & Code ·
-
Datei
FC_V104clean1.c
====================*/ void main(void) { init(); while (1) { READIO(); // Lese Tastenmatrix ein //PORTC=TIMING>>4; PORTC=TAR&0x0f; } return; } /*==================================================================================*/ /*=====================================================================
in „PIC und PICClite läuft nicht richtig“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.c
Ausgänge auf 1 und Pull ups an den Eingängen DDRC = 0xFF; // 11111111 I/o - Konfiguration PORT C PORTC = 0x00; // kompletter Port C auf 0 gesetzt TCCR0 = (1<<CS02)|(1<<CS00); // divide by 1024 TIMSK = 1<<TOIE0; // enable timer interrupt sei(); for(;;) { // main loop // single press PORTD &= ~(1 << KEY_Z1);//Zeile 1 auf 0 setzen if(get_key_press( 1<<KEY_S1 )) { PORTC |= (1<<PC1); PORTC |= (1<<PC2); } }//endfor }
in „Taster Entprellen (gleichzeitige Abfrage)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spimain.c
transmission DATA*/ SPDR = data; /* Wait for transmission complete */ while(!(SPSR & (1<<SPIF))) PORTC=~0x80; } volatile void sendadr(char adr) { /* Start transmission ADDRESS*/ SPDR = adr; /* Wait for transmission complete */ while(!(SPSR & (1<<SPIF))) PORTC=~0x01; } main(void) { // Input/Output Ports
in „SPI Sende-Funktion wird nicht beendet!“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
auswertung.c
Entprellung hochzählen } else{ *piPL = 0; } if (*piPL == 70) { // Entprellung max. Durchlauf erreicht PORTC &= ~(1<<PC2); // PortC Pin2 auf low = Parallel-load EMPFÄNGER *piPL = 0; // Zähler für Entprellung wieder zurücksetzen } else{ return; } *pLV1 = ~*pLV1; // Komplement bilden 1 -> 0 *pLV2 = ~*pLV2;
in „ATMEGA32 Prellspitzen abfangen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Greifer_Kredit_Atmega8.c
Ausgängen *************** DDRB = 0xff; // PortB Ausgänge DDRD = 0xff; // PortD Ausgänge DDRC = 0x00; // PortC Eingänge Bit 1-7; Ausgang Bit 0 PORTC = (1<<PC1) | (1<<PC0); // Pull Up an PC0 und PC1 am PortC aktivieren // timer mode 4, CTC, prescaler 1 TCCR1A = 0; TCCR1B = (1<<WGM12) | (1<<CS10); OCR1A = PERIOD
in „Atmega - Multiplex-Display-Ansteuerung fehlerhaft“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
prog.asm
in save_sreg, SREG ldi keytestcount,0x03 ; sbi portc,2 ;kontroll blinker in iwr0, key_port ;Key-Status einlesen com iwr0 ;low active eor iwr0, key_state and key_ct0, iwr0 ;reset counter and key_ct1, iwr0 com key_ct0 ;count eor key_ct1, key_ct0 and iwr0
in „ATmega8 - Eingänge entprellen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Templesen.asm
0 bcf STATUS,RP0 endm dq_low: macro ;stzt Sende/Empfangs bit auf LOW-empfangen bcf STATUS,RP0 bcf PORTC,0 ;1us auf low initialisiert das lesen der daten bsf STATUS,RP0 bcf TRISC,0 bcf STATUS,RP0 endm wait: macro time ;verzögerung in 5us schritten movlw (time/5)-1 movwf tmp0 call warte5us endm warte5us
in „PIC16F872 ds18s20“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
st7637.h
PINS #define DATA_DIR PORTD.DIR #define DATA_IN PORTD.IN #define DATA_OUT PORTD.OUT #define CMD_DIR PORTC.DIR #define CMD_IN PORTC.IN #define CMD_OUT PORTC.OUT #define CS (1<<0) #define DC (1<<1) #define RD (1<<2) #define WR (1<<3) #define RES (1<<4) #define BL (1<<5) #define COM 0x00 #define DAT 0x01
in „Pointer auf Array in einer for schleife“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
direction for PORTA TRISB = 0b00000001; //I/O direction for PORTB TRISC = 0b00000000; //I/O direction for PORTC PORTA &= 0b011100; //reset PORTA PORTB &= 0b00000001; //reset PORTB PORTC &= 0b00000000; //reset PORTC PIR1 = 0b00000000; //reset interrupt flags PIR2 = 0b00000000; //reset interrupt flags INTCON =
in „Drehimpulsgeber (wiedereinmal.)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
TCCR0 = 0x01; //kein Vorteiler für TIMER0 TCCR1B =0x04; TIMSK = (1<<TOIE0); sei(); //Interrupts an PORTC = 0xF0; act = 0x00; status =0x00; while(1) { //Nullen der ersten beiden Stellen if (!(PINB & (1<<PINB1)) & !(PINB & (1<<PINB2))) { anzeige[3]=0; anzeige[2]=0; _delay_ms(500); } //Nullen der zweiten
in „Variable ändert scheinbar selbstständig ihren Wert“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Main.c
Ausgang definieren // 1 Pull up aktiv = Eingang PORTB = 0b11111111; // Port B Pullup aktivieren //PORTC = 0b00000000; // Port C Ausgang USART_Init(MYUBRR); com74hc595_init(); //////////////////////////////////////////////// // Steigende Flanke Nulldurchgang ///////////////////////////////////////////
in „Mikro brauch nach übertragen meistens noch einen Reset“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
init.c
1 << DDD1); DDRC &=~ (1 << DDC4); DDRD &=~ (1 << DDD4) | (1 << DDD5) | (1 << DDD6) | (1 << DDD7); PORTC |= (1 << PC4); PORTD |= (1 << PD4) | (1 << PD5) | (1 << PD6) | (1 << PD7); // Display // RS PC5 = LOW/OFF // RW PB0 = LOW/OFF // E PB1 = LOW/OFF // D4 PC0 = LOW/OFF // D5 PC1 = LOW/OFF // D6 PC2 =
in „DOGM081 Display Fehlersuche *HILFE*“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SPI_Sensor.c
uint8_t status_reg = 0, outZ[10]; unsigned int i = 0; //Zaehlvariable für Array outZ DDRC = (1<<PC0); PORTC &= ~(1<<PC0); //PC0 auf low fuer LED welche spaeter override anzeigen soll SPI_MasterInit(); //SPI initialization //sei(); //enable global interrupt //9.1 Startup sequence SPI_MasterWrite(CTRL_REG1
in „Bekomme MEMS Accelerometer nicht enabled“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PEMReal.c
INIT_GLOBAL() { DDRC |= 0x10; //Green LED DDRC |= 0x20; //Red LED DDRC |= 0x80; //Reset ENC28J60- PORTC7 as Outgoing PORTC &= ~0x10; // Green LED OFF PORTC &= ~0x20; // Red LED OFF //////////////////////////////// // // HARDRESET ENC28J60 // enc28j60_Hardreset(); // //////////////////////////////// USART0
in „Probleme mit dem myEthernet.kein USART-Signal“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TEST.ASM
PD1 .equ RS = PD2 ;RS an Pin PD2 ;.equ LCD_cntr = PORTD ;PORTD ist Kontroll-Port ;.equ LCD_data = PORTC ;PORTB ist Daten-Port .equ BF = PC7 ;Busy flag ;LCD Befehle .equ clear_LCD = 0b00000001 ;loesche Anzeige .equ home_LCD = 0b00000010 ;return home .equ set_LCD = 0b00111000 ;8 bits,2 Zeilen,5x7dots .
in „LCD-Befehl Problem“ · Mikrocontroller und Digitale Elektronik ·