-
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 |= _BV(7); // Pull Up an PortC7 aktivieren PORTC |= (1<<PC0); // Pull Up an Pin0 am PortC aktivieren PORTC |= (1<<PC1); // Pull Up an Pin1 am PortC aktivieren //PORTC = 0xff; } //********************************* int main(void) { counter = 17; // ******** Initialisierung *********************************************************************** initial(); // Initialisierung
in „Atmega - Multiplex-Display-Ansteuerung fehlerhaft“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Lcd_4x20.bas
---------------------------------------------------------- ' Init Lcd Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 Config Lcdpin = Pin , E = Portc.4 , Rs = Portc.5 Config Lcd = 20 * 4 Config Lcdbus = 4 Cursor Off Cls Upperline Lcd " * Test * " Lowerline Lcd " erster
in „BASCOM: große Zahlen über alle 4 Zeilen eines 4-Zeiligen L“ · Projekte & Code ·
-
Datei
dcf77.bas
$regfile = "8515def.dat" $crystal = 4000000 Config Lcd = 20 * 4 Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.5 , Rs = Portc.4 Config Lcdbus = 4 Cls Ddrd = &B00101111 Portd.6 = 1 Ddrb = &B11111111 Portb = &B11111111 Taster Alias Pind.0 Led Alias
in „DCF77, Frage ob Modul Signal liefert (AT8515)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Text01.c
int main (void) { unsigned long int i; DDRA = 0xff; DDRC = 0xFF; PORTA = 0x10; // Beleuchtung ein PORTC = 0x00; for (i=0; i<10000; i++); // LCD init PORTC = 0x38; // 8 Bit, 4 Zeilen E_toggle(); PORTC = 0x01; // Display löschen E_toggle(); PORTC = 0x0E; // Display an, Cursor an, Blinken aus E_toggle(); PORTC = 0x06; // Entry Mode Set, Incrementieren, no Shift E_toggle(); PORTC = 0x02; // Cursor home LCD_puts ("moin moin"); while(1) { /* "leere" Schleife*/; } /* wird nie erreicht */ return 0; }
in „Wie mache ich eine Textausgabe 8Bit auf Display?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LT1286.c
0; //12bit value from LT1286 int bit_count = 0; //Counter for bit uint8_t Pin_data = 0; //Data in PORTC |= (1<<CS); //CS inactive PORTC &=~(1<<CLK); //Reset CLK PORTC &=~(1<<CS); //CS activ _delay_us(2); for (bit_count = 0; bit_count < 15; bit_count ++) { adc_value = adc_value * 2; //shift left PORTC |= (1<<CLK); //Set CLK _delay_us(2); PORTC &=~(1<<CLK); //Reset CLK Pin_data = (PINC & 0b00000100) >> 2; //PC2 2 times shift right adc_value = adc_value + Pin_data; _delay_us(1); } PORTC |= (1<<CS); //CS inactive adc_value = (adc_value & 0x0fff
-
Datei
auslesen_id.txt
$regfile = "m8515.dat" $crystal = 1000000 Config 1wire = Porta.0 Config Lcdpin = Pin , Db4 = Portc.5 , Db5 = Portc.4 , Db6 = Portc.3 , Db7 = Portc.2 , E = Portc.6 , Rs = Portc.7 Config Lcd = 16 * 2 Cursor Off Cls Config Portd = Input Dim Ar(8) As Byte Dim I As Integer Do Cls Locate 1 , 1 Lcd "warten
in „1W und DS18S20“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Ping_Pong.txt
200); Status++; } else if (PINB & (1<<PB7)) { _delay_ms(200); Status--; } switch(Status) { case 1: PORTC = 0b00100000; PORTD = 0b11110011; PORTB = 0b00000111; break; case 2: PORTC = 0b00110000; PORTD = 0b11110001; PORTB = 0b00000111; break; case 3: PORTC = 0b00111000; PORTD = 0b11110000; PORTB = 0b00000111; break; case 4: PORTC = 0b00011100; PORTD = 0b11110000; PORTB = 0b00000111; break; case 5: PORTC = 0b00001110; PORTD = 0b11110000; PORTB = 0b00000111; break; case 6: PORTC = 0b00000111; PORTD = 0b11110000; PORTB = 0b00000111
in „Ping-Pong über LED-Brett für Anfänger“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd-routines.h
define CURSOR_HOME 0x02 // Pinbelegung für das LCD, an verwendete Pins anpassen #define LCD_PORT_4 PORTC #define LCD_DDR_4 DDRC #define LCD_D4 PC0 #define LCD_PORT_5 PORTC #define LCD_DDR_5 DDRC #define LCD_D5 PC1 #define LCD_PORT_6 PORTC #define LCD_DDR_6 DDRC #define LCD_D6 PC2 #define LCD_PORT_7 PORTC #define LCD_DDR_7 DDRC #define LCD_D7 PC3 #define LCD_RS_PORT PORTC #define LCD_RS_DDR DDRC #define LCD_RS PC4 #define LCD_EN1_PORT PORTC #define LCD_EN1_DDR DDRC #define LCD_EN1 PC5
in „LCD an ATmega8 mit C ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test168.c
void Ports (); /* Hauptprogramm */ int main (void) //{ //Ports(); // Ports // LEDs einschalten //PORTC = (1<<PC0) | (1<<PC1) | (1<<PC2) | (1<<PC); { // LED per Bass einschalten if (PIND&(1<<PIN0)) { // Wenn Bass an PORTD (PIND0) anliegt schalte LEDs PORTC |= (1<<PC0); } // ... |= > Bit setzen an PORTC1 = LEDs an else { PORTC &=~ (0<<PC0); } // ... &=~ > Bit löschen an PORTC1= LEDs aus while(1) { } return 0; // Schleife } /* Initalisierungsanweisungen */ /* Porteinstellungen */ // Datenrichtungsregister: 0=Eingänge, 1=Ausgänge
in „Audiotisch (Daft Punk)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd-routines.h
define CURSOR_HOME 0x02 // Pinbelegung für das LCD, an verwendete Pins anpassen #define LCD_PORT_4 PORTC #define LCD_DDR_4 DDRC #define LCD_D4 PC1 #define LCD_PORT_5 PORTC #define LCD_DDR_5 DDRC #define LCD_D5 PC3 #define LCD_PORT_6 PORTC #define LCD_DDR_6 DDRC #define LCD_D6 PC0 #define LCD_PORT_7 PORTC #define LCD_DDR_7 DDRC #define LCD_D7 PC2 #define LCD_RS_PORT PORTC #define LCD_RS_DDR DDRC #define LCD_RS PC5 #define LCD_EN1_PORT PORTC #define LCD_EN1_DDR DDRC #define LCD_EN1 PC4
-
Datei
My-Code.txt
RS zu setzen mov temp2, temp1 swap temp1 andi temp1, 0b00001111 out PORTC, temp1 rcall lcd_enable andi temp2, 0b00001111 out PORTC, temp2 rcall lcd_enable rcall delay50us ret ;erzeugt den Enable-Puls lcd_enable: sbi PORTC, 5 ;Enable high nop ;3 Taktzyklen warten nop nop
in „Hilfe!!! RTC will nicht.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Slave_MCU.txt
(((LEDParameter[n] >> 8)) > m) { maskPORTA[m] |= LEDParameter[n]; }; } } for(m=0;m<=99;m++) { maskPORTC[m] = 0; for(n=7;n<=15;n++) { if(((LEDParameter[n] >> 8)) > m) { maskPORTC[m] |= LEDParameter[n]; }; } } for(m=0;m<=99;m++) { maskPORTD[m] = 0; for(n=16;n<=23;n++) { if(((LEDParameter[n] >> 8)) > m)
in „SPI SLAVE Interrupt Problem - Soft PWM“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Empfangen1.c
) NrCompare_Servo1 = 0; OCR2A = Array_Servo1[ NrCompare_Servo1]; // Den Timer damit laden } else {PORTC |= (1 << PC0);} //Highpegel während der 90ms Pause } //Zweits Signal { if((Count_Servo2 >= 19) && (Count_Servo2 <= 36)){ if(NrCompare_Servo2 % 2 == 0) PORTC &= ~(1 << PC2); else {PORTC |= (1 << PC2
in „UART&Timer Interrupt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Slave.c
plusminus) //Funktion die am gewünschten PORT ein Freigabeimpuls erzeugt { switch(plusminus) { case 0: PORTC &=~ (1<<PC0); //minus PORTC &=~ (1<<PC2); //rot break; case 2: PORTC&=~(1<<PC0); //minus PORTC&=~(1<<PC1); //grün break; } } void output_ausschalten(void) { PORTC |=(1<<PC0);//masse "ausschalten" while(wait<20) //Pausenzeit zwischen den Impulsen { wait++; } PORTC|=(1<<PC2); //rot PORTC |=(1<<PC1); //grün wait=0; } uint8_t ausgabe (uint8_t temp, uint8_t feld) //erzeugt, nach der Berechnung, das Muster für das Schieberegister { uint8_t schwachsinn=0; uint8_t
in „TWI - Wie lege ich die Adresse von einem Slave fest?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Xmega_IO_bits_definition.h
5 #define PINB6 6 // Port B Input Pins bit 6 #define PINB7 7 // Port B Input Pins bit 7 // ***** PORTC ************************ // PORTC - Port C Data Register #define PORTC0 0 // Port C Data Register bit 0 #define PC0 0 // For compatibility #define PORTC1 1 // Port C Data Register bit 1 #define PC1 1 // For compatibility #define PORTC2 2 // Port C Data Register bit 2 #define PC2 2 // For compatibility #define PORTC3 3 // Port C Data Register bit 3 #define PC3 3 // For compatibility #define PORTC4 4 // Port C Data Register bit 4
in „ATMEGA zu XMEGA Code“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
steuerung.bas
Speaker Alias Portd.7 Fokus Alias Portb.1 Ausloesung Alias Portb.0 Fokus = 0 Ausloesung = 0 A1 Alias Portc.2 B1 Alias Portc.4 A2 Alias Portc.3 B2 Alias Portc.5 Const Keyu = 1 Const Keyd = 2 Const Keyr = 3 Const Keyl = 4 Const Keye = 5 Dim W As Word Dim N As Byte Dim Mnuselect As Word Dim Mnuanzahl As Byte
in „Timer und Stepper, Bascom -> Hilfe“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
I2c_adresse_suchen.bas
$regfile = "m8def.dat" $crystal = 3686400 config lcdpin = pin , db4 = portc.2 , db5 = portc.3 , db6 = portc.4 , db7 = portc.5 , E = portc.1 , Rs = portc.0 config Lcd = 20 * 4 Cls Cursor off Config Sda = Portb.4 Config Scl = Portb.5 dim Msb as byte dim Lsb as byte Dim A as
in „Wieder einmal Temperaturmessung mittels PT1000.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd.h
// LCD driver for KS0070B // RS #ifndef RSPORT #define RSPORT PORTC #endif #ifndef RSDDR #define RSDDR DDRC #endif #ifndef RS #define RS PC5 #endif // Enable #ifndef EPORT #define EPORT PORTC #endif #ifndef EDDR #define EDDR DDRC #endif #ifndef E #define E PC4 #endif // DB 4 #ifndef DB4PORT #define DB4PORT PORTC #endif #ifndef DB4DDR #define DB4DDR DDRC #endif #ifndef DB4 #define DB4 PC3 #endif // DB 5 #ifndef DB5PORT #define DB5PORT PORTC #endif #ifndef DB5DDR #define DB5DDR DDRC #endif #ifndef DB5 #define
in „LCD in C: Befehle ja, Daten nein“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Zahlenschloss_2.c
main(void) { DDRD=0x00; DDRC=0x07; int i=0; int code[3]; while(1) { while (i<4) { if(PINC & 0x08) { PORTC=0x02; _delay_ms(100); switch(PIND) { case 0x00: code[i] = 0; break; case 0x01: code[i] = 1; break; case 0x02: code[i] = 2; break; case 0x03: code[i] = 3; break; case 0x04: code[i] = 4; break; case
in „Zahlenschloss mit mega8 problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Praeambel-Empfang.bas
On Timer1 Timer_irq On Int1 On_int1 Config Pind.3 = Input Portd.3 = 1 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 Do Cls Locate 1 , 1 Lcd Bin(datar) Locate 2 , 1 If Datar = 1 Then Lcd "Start gefunden" Waitms 500
in „Funkprotokoll dekodieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.h
***************************************************************************/ #define LCD_D4 SBIT( PORTC, 6 ) #define LCD_DDR_D4 SBIT( DDRC, 6 ) #define LCD_D5 SBIT( PORTC, 5 ) #define LCD_DDR_D5 SBIT( DDRC, 5 ) #define LCD_D6 SBIT( PORTC, 4 ) #define LCD_DDR_D6 SBIT( DDRC, 4 ) #define LCD_D7 SBIT( PORTC, 3 ) #define LCD_DDR_D7 SBIT( DDRC, 3 ) #define LCD_RS SBIT( PORTC, 2 ) #define LCD_DDR_RS SBIT( DDRC, 2 ) #define LCD_E0 SBIT( PORTC, 7 ) #define LCD_DDR_E0 SBIT( DDRC, 7 ) #endif
in „Benötige Hilfe bei 4x20 LCD Treiber von Peter Danegger“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
functions.c
; //wait until Write-In-Progress Bit (Bit0) is 0 // activate WRITE ENABLE LATCH: // pull down /CS PORTC &= ~(1<<3); spi_send(0x06); // release /CS PORTC |= (1<<3); asm volatile ("nop"); // pull down /CS PORTC &= ~(1<<3); //WRITE Command spi_send(0x2); //Adress 2 Byte spi_send(adress16 & 0xFF); //Most
in „komisches Problem mit for-Schleife“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
void write_byte(unsigned char dat_or_cmd) { int i; for(i=0; i<8; i++) { if (dat_or_cmd & 0x80) { PORTC |=(1<<OLED_SDIN); }//OLED_SDIN = 1; } else { PORTC &=~(1<<OLED_SDIN); }//OLED_SDIN = 0; } dat_or_cmd = dat_or_cmd << 1; //OLED_SCLK = 0; PORTC &=~(1<<OLED_SCLK); //OLED_SCLK = 1; PORTC |=(1<<OLED_SCLK); } //OLED_SDIN = 0; PORTC &=~(1<<OLED_SDIN); } void OledInit(void) { unsigned int a; PORTC &=~(1<<OLED_RES); delay(10); PORTC |=(1<<OLED_RES); delay(200); write_cmd(0x15); // Set Column Address write_cmd(0x07); // Begin 7 Offset
in „Blutzucker-Messgerät Hardware OLED Display“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
display1.txt
; Siehe dazu http://www.mikrocontroller.net/topic/81974#685882 lcd_enable:nop nop nop nop nop sbi PORTC, 1 ; set bit PortC bit 1 => Enable high nop ; 3 Taktzyklen warten nop nop nop nop cbi PORTC, 1 ; Enable wieder low ret ; Und wieder zurück ; Pause nach jeder Übertragung delay50us: ; 50us Pause ldi
in „Displaytech162 LCD am Atmega8“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd_routinen.h
///////////////////////// // Porteinstellungen // LCD Daten-Port und Startpin #define LCD_PORT_DB PORTC #define LCD_DDR_DB DDRC #define LCD_DB PC0 // LCD RS <--> PORTC Bit PC4 (RS: 0=Data, 1=Command) #define LCD_PORT_RS PORTC #define LCD_DDR_RS DDRC #define LCD_RS PC4 // LCD RW <--> PORTC Bit PC6 (RW: 0=Write, 1=Read) #define LCD_PORT_RW PORTC #define LCD_DDR_RW DDRC #define LCD_RW PC5 // LCD EN <--> PORTC Bit PC5 (EN: 1-Impuls für Daten) #define LCD_PORT_EN PORTC #define LCD_DDR_EN DDRC #define LCD_EN PC6 ///////////////////////////////
in „avr-gcc stört sich an uint_8 und uint“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
m8a_Pin-Test.c
PORTB, _BV(PB4) }, { (uint16_t)&DDRB, (uint16_t)&PORTB, _BV(PB5) }, { (uint16_t)&DDRC, (uint16_t)&PORTC, _BV(PC0) }, { (uint16_t)&DDRC, (uint16_t)&PORTC, _BV(PC1) }, { (uint16_t)&DDRC, (uint16_t)&PORTC, _BV(PC2) }, { (uint16_t)&DDRC, (uint16_t)&PORTC, _BV(PC3) }, { (uint16_t)&DDRC, (uint16_t)&PORTC, _BV(PC4) }, { (uint16_t)&DDRC, (uint16_t)&PORTC, _BV(PC5) }, { (uint16_t)&DDRD, (uint16_t)&PORTD, _BV(PD0) }, { (uint16_t)&DDRD, (uint16_t)&PORTD, _BV(PD1) }, { (uint16_t)&DDRD, (uint16_t)&PORTD, _BV(PD2) }, { (uint16_t)&DDRD, (uint16_t)&PORTD,
in „Atmega8A: loop über Ports/Pins funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
MENUE_Interrupt-Abfrage_Anzeige_Deklarierung.bas
maximale Anzahl Menüeinträge angegeben werden. Const Mnumaxlines = 10 ' Einstellungen zum LCD Config Portc = Output Config Portd.7 = Output Config Portd.6 = Output Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2 Config Lcd = 16 * 2 Cursor
in „RXC Interrupt Problem ( Bascom)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
#define GLOFF PORTC&=~(1<<PC5) // Gleis links abschalten #define GMOFF PORTC&=~(1<<PC4) // Gleis links abschalten #define GROFF PORTB&=~(1<<PB1) // Gleis links abschalten #define GGOFF PORTB&=~(1<<PB0) // Gleis links
in „Flash Speicher sparen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Segment_LCD.asm
100's A, B, C & D bits ldi temp, 0b00000001 out DDRC, temp ;COM1 auf Ausgang, COM2 auf Eingang cbi PORTC, 1 ;COM2 kein pullup sbi PORTC, 0 ;COM1 auf High com segs_out_1 out PORTD, segs_out_1 ;Seg1 com segs_out_2 out PORTB, segs_out_2 ;Seg2 rjmp Zaehler Fall_1: ldi mask, 0xF0 ;COM2 rcall LCD_1 mov temp
in „AVR241 mit Code für anderen Compiler“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Neu_Textdokument__2_.txt
definitions */ void turn_on( int xpos, int ypos ) { switch( xpos ) { case 0: switch( ypos ) { case 0: PORTC |= (1<<PC0); break; case 1: PORTC |= (1<<PC1); break; case 2: PORTC |= (1<<PC2); break; } break; case 1: switch( ypos ) { case 0: PORTC |= (1<<PC3); break; case 1: PORTC |= (1<<PC4); break; case 2:
in „LED Dimmen ohne PMW am Atmega8“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
mega8.txt
Initialisierung out SPH,R16 ldi R16,lo8(RAMEND) out SPL,R16 ; Ports B2-5 werden durch SPI-Init festgelegt ; PORTC0 für ADC sbi DDRC,1 ; PORTC1 als Ausgang (SS1) sbi PORTC,1 ; Pegel high sbi DDRC,2 ; PORTC2 als Ausgang (SS2) sbi PORTC,2 ; Pegel high cbi DDRC,3 ; PORTC3 als Eingang (Slave-Rückmeldung) sbi PORTC,
in „SPI Kopplung von ATmega8 und ATtiny 2313“ · Projekte & Code ·
-
Datei
main.c
0,1); lcd_string(ausgabe); _delay_ms(1000); break; } } } return result; } void control_init(void) { PORTC &= ~(1<<CON_RESET); _delay_ms(10); PORTC |= (1<<CON_RESET); // Reset des Controlboards für 10ms PORTC |= (1<<CON_PDN | 1<<CON_MUTE); // Power ON TAS5558 and Unmute } /* ADC initialisieren */ void ADC_Init
in „C-Code auf AVR effizient schreiben“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ide.bas
= 1 'reset high Waitms 5000 Porta.5 = 0 Waitms 5 Porta.5 = 1 Cls Home Lcd "Resetted Disk" 'Config Portc = Output Call Busycheck Home Lcd "Device Ready" '***************** Porta.2 = 1 Porta.3 = 1 Porta.4 = 1 'select command register Portc = 145 Porta.0 = 0 Waitms 1 Porta.0 = 1 '******************* Portc
in „ATA-Zugriffs Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd.c.txt
- 64 char start = 63; setStart(start); //Daten schreiben ASCII write(); } } void displayState() { PORTC = 0x00; PORTD = 0x3f; } void setAddress(char zeile) { PORTC = 0b00000000; PORTD = (0b01000000) ^ zeile; } void setPage(char seite) { PORTC = 0b00000000; PORTD = (0b10111000) ^ seite; } void setStart(char start) { PORTC = 0b00000000; PORTD = (0b11000000) ^ start; } void write() { PORTC = 0b00000010; PORTD = 0b11111111; } void init() { PORTB = 0b00101111; }
in „komisches Displayverhalten“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
erstes_proggi.bas
Dim A_2 As Integer Dim Prell_1 As Single Dim Prell_2 As Single Do If A_1 >= 61 And Prell_1 = 1 Then Portc.1 = 0 Prell_1 = 0 A_1 = 0 End If If A_2 >= 61 And Prell_2 = 1 Then Portc.2 = 0 Prell_2 = 0 A_2 = 0 End If If A_1 >= 61 And Prell_1 = 0 Then Portc.1 = 1 Prell_1 = 1 A_1 = 0 End If If A_2 >= 61 And Prell_2 = 0 Then Portc.2 = 1 Prell_2 = 1 A_2 = 0 End If Loop End Timer0_dull: A_1 = A_1 + 1 Return Timer1_dull: A_2 = A_2 + 1 Return
in „erster Atmega ->“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DS18B20_go1.bas
framesize = 50 '===================== Pinkonfiguration ===================== Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , _ Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2 Config Lcd = 16 * 4 Config 1wire = Portd.5 Cls Cursor Off '=================== Variablendeklaration ================
in „DS18B20 - Zwei Routinen zum checken“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DS18B20_go2.bas
framesize = 50 '===================== Pinkonfiguration ===================== Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , _ Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2 Config Lcd = 16 * 2 Config 1wire = Portd.5 Cls Cursor Off '=================== Variablendeklaration ================
in „DS18B20 - Zwei Routinen zum checken“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LTC2600.c
#include <asf.h> #define LTC2600_CS IOPORT_CREATE_PIN(PORTC, 0) struct spi_device LTC2600_cs; volatile uint16_t LTC2600_val; void LTC2600_init(void) { // SPI ioport_configure_port_pin(&PORTC, PIN0_bm, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH); // Chip Selects ioport_configure_port_pin(&PORTC, PIN4_bm, IOPORT_DIR_INPUT | IOPORT_PULL_UP); // SS ioport_configure_port_pin(&PORTC, PIN5_bm, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH); // MOSI ioport_configure_port_pin(&PORTC, PIN6_bm, IOPORT_DIR_INPUT
in „SPI an XMEGA geht MOSI nicht hi“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
AusgangOut(); theRelais->setCycles = 0; return true; } return false; } void Eingaenge_abfragen (void) { PORTC |= (1<<PC4); // Mit PL alle Eingänge in das Register schieben. // PL auf High PORTC |= (1<<PC5); // PL auf Low PORTC &= ~(1<<PC5); // PL auf High PORTC |= (1<<PC5); //Abfragen welches Registerbit gesetzt
in „Interrupt Variable übergeben“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
AusgangOut(); theRelais->setCycles = 0; return true; } return false; } void Eingaenge_abfragen (void) { PORTC |= (1<<PC4); // Mit PL alle Eingänge in das Register schieben. // PL auf High PORTC |= (1<<PC5); // PL auf Low PORTC &= ~(1<<PC5); // PL auf High PORTC |= (1<<PC5); //Abfragen welches Registerbit gesetzt
in „Parsen klappt nur bis zur ersten Stelle.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Display_1.bas
**************** Startzeile 0 Portc = 192 En = 1 : Waitms 10 : En = 0 Waitms 100 : Do : Loop Until Taste = 0 '********************** Page 0 Portc = 185 En = 1 : Waitms 10 : En = 0 Waitms 100 : Do : Loop Until Taste = 0 '********************** Adresse 0 Portc = 64 En = 1 : Waitms 10 : En = 0 Waitms 100 : Do : Loop Until Taste = 0 '********************** Pixel ausgeben Di = 1 Portc = 255 En = 1 : Waitms 10 : En = 0 Waitms 100 : Do : Loop Until Taste = 0
in „KS0108B Displaytech 64128A“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LED_cude_test.25.12.2012.c
32, 64, 128}; int main(void) { PORTE.DIRSET = 0xFF; /* PORTE als Ausgang. Matrix 74ACT573(Dx8) */ PORTC.DIRSET = 0xFF; /* PORTC als Ausgang. Matrix (8xLE(74ACT573)) */ PORTH.DIRSET = 0xFF; /* PORTH als Ausgang. 74HCT273D(Ebene) */ PORTA.DIRSET = 0xFF; int pause=0; while(1) { PORTA.OUTCLR = PIN0_bm; PORTH.OUT = reihen[9]; PORTA.OUTSET = PIN0_bm; PORTE.OUT = 0xFF; PORTC.OUT = 0xFF; PORTC.OUT = 0x00; while(1) { PORTE.OUT = 0x00; PORTC.OUT = 64; } } } /* PORTE.OUTCLR = 0xFF; PORTC.OUTSET = 0xFF; int8_t lauf=0; for(lauf=1; lauf<=8; lauf++) { PORTA.OUTCLR = PIN0_bm; PORTH.OUT
in „Probleme mit 74ACT573“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
MIDI_D_mpfung_Timeout_V101.bas
R16teiler ldi R16teiler,0 ' Stufe 0 - alles Rücksetzen S0_l1: ' ldi r24,65 ' rcall Wait_send sbi portc,2 cbi portc,4 cbi portc,3 cbi portb,2 cbi portb,1 ldi r24,32 ' Wartezeit = Impulsdauer Trigger 1 und Reset Hold S0_l2: subi r24,1 cpi r24,0 brne s0_l2 ldi r24,&H08 sts TCCR1B,r24 ' Timer 1 stoppen
in „Problem mit AVR OCA Interrupt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
servo.bas
deklarieren Declare Sub On_int0 Declare Sub On_int1 'LCD Initialisieren 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 Cls Cursor Off 'PD2(Int0) und PD3(INT1) als Eingang , PD7 und PD7 als PB0(Servo) und PB0 als Ausgang
in „Bascom Unerklärlicher Fehler im Programm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
servo.bas
deklarieren Declare Sub On_int0 Declare Sub On_int1 'LCD Initialisieren 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 Cls Cursor Off 'PD2(Int0) und PD3(INT1) als Eingang , PD7 und PD7 als PB0(Servo) und PB0 als Ausgang
in „Bascom Unerklärlicher Fehler im Programm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TEMOD-I2C-test.bas
40 ' Hardware Stack $swstack = 32 ' SW Stack $framesize = 60 ' Frame Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portb.2 , Rs = Portb.1 Config Lcd = 16 * 2 Cls Cursor Off Waitms 250 Config Sda = Portc.4 Config Scl = Portc.5 I2cinit Dim Dat(2) As Byte Dim
in „Hygrosens I2C Bus Spec“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Schieberegister_Taster.bas
Alias Sr1.0 Taster2 Alias Sr1.1 Taster3 Alias Sr1.2 Config Lcdbus = 4 Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 _ , Db7 = Portc.3 , E = Portc.4 , Rs = Portc.5 Config Lcd = 16 * 2 Do 'Schieberegister auswärten Call Populate_shift_register() 'Status der LEDs einstellen, die über
in „74HC165 Atmega32 mit 24 Taster“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
iom644pa.h
#define DDC2 2 #define DDC3 3 #define DDC4 4 #define DDC5 5 #define DDC6 6 #define DDC7 7 #define PORTC _SFR_IO8(0x08) #define PORTC0 0 #define PORTC1 1 #define PORTC2 2 #define PORTC3 3 #define PORTC4 4 #define PORTC5 5 #define PORTC6 6 #define PORTC7 7 #define PIND _SFR_IO8(0x09) #define PIND0 0 #define
in „ATMega644p USART-Interruptvector?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
define.h
PORTA = (0x00) ) #define CONFIG_PORTB() (DDRB = _G_SENSE | , PORTB = 0x00 | _G_SENSE ) #define CONFIG_PORTC() (DDRC = 0xFF , PORTC = 0x00 ) #define CONFIG_PORTD() (DDRD = _SCL | _SDA) #define CONFIG_PORTE() (DDRE = 0xF0 , PORTE = 0x00 ) #define CONFIG_PORTF() (DDRF = 0x00 , PORTF = 0x00 ) #define CONFIG_PORTG
in „AD-Wandlung und Nutzung JTAG möglich?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
void delayms(uint16_t ms){ while(ms>0){_delay_ms(1);ms--;} } void displayhou(uint8_t h){ if(h&0x01)PORTC|=(1<<PINC2); else PORTC&=~(1<<PINC2); if(h&0x02)PORTC|=(1<<PINC3); else PORTC&=~(1<<PINC3); if(h&0x04)PORTC|=(1<<PINC4); else PORTC&=~(1<<PINC4); if(h&0x08)PORTC|=(1<<PINC5); else PORTC&=~(1<<PINC5
in „Uhr mit quarz, Atmega48 und AVRC“ · Mikrocontroller und Digitale Elektronik ·