-
Datei
ATA_Floppy_mit_ATmega.txt
read DDRB=0b11; PORTB=PORTB | 0b11; //Da beide Signale invertiert, müssen sie per default an sein PORTC=PORTC | (0b11<<5); //Chip select ist ebenfalls invertiert TWCR=0b100 | (1<<6); //TWI Enable TWBR=72; //100kHz bei CPU @ 16MHz TWAR=20; //Slave adress: 20 DDRD=0; //Lo-Byte Datenleitung DDRA=0; //High-Byte Datenleitung PORTD=255; PORTA=255; PORTC=PORTC | (1<<7); //Reset abschalten => Laufwerke hochfahren PORTC= (PORTC & clr_bit) | stat_command; //Alternate status register anwählen while(1){ PORTB=PORTB & ~0b10; //read __asm volatile("NOP");
in „ATA Floppy mit ATmega1284P ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
code.txt
auswählen 'LCD Konfigurieren Config Lcd = 16 * 2 ' 16*2 LCD auswählen Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portb.4 , Rs = Portd.7 ' LCD Pins initialisieren Config Porta.3 = Input 'Tastatur Reihen auf Eingang stellen Config Porta.2 = Input ' "" Config
in „Bascom Avr Alternative“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
K2Settings = bit_clear_K2(0b01000000, K2Settings); K2Settings = bit_clear_K2(0b10000000, K2Settings); PORTC = 0x00; // Lösche PORTC PORTD = 0x00; // Lösche PORTD } void peripherie_LED(void) { K2Settings = bit_clear_K2(0b00000001, K2Settings); TRISC = 0x00; PORTC = 0x00; } void peripherie_NoLED(void) { K2Settings
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
K2Settings = bit_clear_K2(0b01000000, K2Settings); K2Settings = bit_clear_K2(0b10000000, K2Settings); PORTC = 0x00; // Lösche PORTC PORTD = 0x00; // Lösche PORTD } void peripherie_LED(void) { K2Settings = bit_clear_K2(0b00000001, K2Settings); TRISC = 0x00; PORTC = 0x00; } void peripherie_NoLED(void) { K2Settings
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
K2Settings = bit_clear_K2(0b01000000, K2Settings); K2Settings = bit_clear_K2(0b10000000, K2Settings); PORTC = 0x00; // Lösche PORTC PORTD = 0x00; // Lösche PORTD } void peripherie_LED(void) { K2Settings = bit_clear_K2(0b00000001, K2Settings); TRISC = 0x00; PORTC = 0x00; } void peripherie_NoLED(void) { K2Settings
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
= 0x00; PORTC = 0x00; } void peripherie_NoLED(void) { K2Settings = bit_set_K2(0b00000001, K2Settings); PORTC = 0x00; } void peripherie_I2C(void) { SDADir = 0; TRISCbits.TRISC3 = 0; SCL = 1; SDA = 1; K2Settings =
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
= 0x00; PORTC = 0x00; } void peripherie_NoLED(void) { K2Settings = bit_set_K2(0b00000001, K2Settings); PORTC = 0x00; } void peripherie_I2C(void) { SDADir = 0; TRISCbits.TRISC3 = 0; SCL = 1; SDA = 1; K2Settings =
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
CONS4.ASM
out PORTC, r16 rcall schalts ldi temp, '3' rcall senden ;Unterprogramm aufrufen sbr r19,4 out PORTD, r19 rjmp loop ;__________________________________________ schalt4: sbrs r16,4 rjmp loop sbr r16,4 cbr r16,8 out PORTC, r16 rcall schalts ldi temp, '4' rcall senden ;Unterprogramm aufrufen sbr r19,4 out PORTD, r19 rjmp loop ;__________________________________________ schalt5: ;sbrs r16,32 ;rjmp loop sbr r16,32 cbr
in „Taster entprellen ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
100620_16F1936_Port_Test4.ASM
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' BANKSEL PORTC ; CLRF PORTC ;Init PORTC BANKSEL LATC ;Data Latch CLRF LATC ; BANKSEL TRISC ; movlw b'11000000' ;PortC Bit7 + Bit6 als Eingang Rest Ausgang MOVWF TRISC ;BIT6 TX Bit7 RX=löschen ;'''''''''''''''''''
in „EUSART in XX.ASM“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
6963.c
6963_CD_DDR, _6963_CD_P) // Ausgang #define _6963_CD_H sbi (_6963_CD_PORT, _6963_CD_P) //WR -> H, PortC Pin3 setzen #define _6963_CD_L cbi (_6963_CD_PORT, _6963_CD_P) //WR -> L, PortC Pin3 löschen //---------------------------------------------------------- //------------------- Reset ---------------
in „Grafikdisplay mit T6963-Controller“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.bas
regfile = "m16def.dat" Config Lcd = 16 * 2 'damit läuft auch ein 8*2 LCD Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.5 , Rs = Portc.4 Cls Cursor off locate 1,1 Lcd "Zeile 1" locate 2,1 Lcd "Zeile 2" end
in „LCD am AVR Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
#include "main.h" int main (void) { uart_init(); DDRC = 0xFF; // PORTC Ausgang sei(); while (1) { PORTC = uart_string[0]; _delay_ms(5000); PORTC = uart_string[1]; _delay_ms(5000); PORTC = 0xFF; _delay_ms(50); PORTC = 0x00; _delay_ms(50); PORTC = 0xFF; _delay_ms(5000);
in „Globale Variablen im ISR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd_8515.bas
crystal = 6000000 $baud = 9600 Config Porta = Output $lib "EA+DIP204.LIB" Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.7 , Rs = Portc.5 Config Lcd = 20 * 4 Initlcd Cls Dim X As Byte X = 100 Lcd X Do loop
in „BASCOM: große Zahlen über alle 4 Zeilen eines 4-Zeiligen L“ · Projekte & Code ·
-
Datei
stoppuhr.c
uhr stoppen */ flag = 0; } else{ flag = 1; } PORTD = display_number[display]; switch(s1){ case 0: PORTC = display_decode[h2]; break; case 1: PORTC = display_decode[h1]; break; case 2: PORTC = display_decode[m2]; break; case 3: PORTC = display_decode[m1]; break; case 4: PORTC = display_decode[s2]; break; case 5: PORTC = display_decode[s1]; break; default: PORTC = 0x00; } } return 0; } SIGNAL(SIG_OVERFLOW1){/*timer interrupt*/ if(display <= 6){ display++; } else display = 0; if(flag == 1){ temp++; } if(temp == 1000
in „timer interrupt problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
testing.c
(); } // While end PORTC &= ~(1<<PC2); if(OCR1A==OCR1A_tmp) _delay_ms(20); } // while End PORTC &= ~(1<<PC3); } // main End void Timer1_init(void) // Configre for PWM (2 Channels) and 20ms Overflow { // Clear OC1A/OC1B on
in „if Abfrage in main() ignoriert?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd_init.asm
5. LCD-Routine ; 5.1 LCD -> Daten übertragen lcd_data: CBI PORTC, 1 ;R/W=Low, Schreiben aktiv SBI PORTC, 2 ;RS=High, Daten werden gesendet OUT PORTA, temp1 ;Übergabe des zu sendenden Bytes an das LCD rcall lcd_enable ;Aufruf lcd_enable rcall lcd_delay50us ;Aufruf
in „LCD Initialisierung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
bascom.bas
when needed '$LIB "LCD4.LBX" $regfile = "M16def.DAT" $crystal = 1000000 Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.6 , Rs = Portc.4 Config Lcd = 16 * 2 Initlcd Cls Lcd "Hallo" End
in „Problem Bascom / LCD mit Atmega16“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test3.bas
B00100000 Ddrc = &B00000000 Portd.5 = 0 Config Lcdbus = 4 Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2 Waitms 100 Initlcd Do Cls Locate 1 , 1 Lcd "Hello" Portd.5 = 1 Wait 5 Portd.5 = 0 Loop End
in „LCD zeigtn ichts an ( Bascom)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test3.bas
Portd.5 = 0 Config Lcdmode = Port 'Config Lcdbus = 4 'Config Lcd = 16 * 2 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 Waitms 100 Initlcd Do Cls Locate 1 , 1 Lcd "Hello" Portd.5 = 1 Wait 5 Portd.5 = 0 Loop End
in „LCD zeigtn ichts an ( Bascom)“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
ReciprCnt.pdf
inp. .equ PrtB0 = 0 ; PortB Bit0 = input QA(=T0 count inp.) ; Port C connections: .equ PrtC7 = 7 ; PortC Bit7 = not used .equ DP = 6 ; PortC Bit6 = output store decimal point active low .equ ONE = 5 ; PortC Bit5 = output leading "one" digit .equ KILO = 4 ; PortC Bit4 = output "k"Hz digit .equ DB3 = 3 ; PortC Bit3 = output LCD-databus Bit 3 .equ DB2 = 2 ; PortC Bit2 = output LCD-databus Bit 2 .equ DB1 = 1 ; PortC Bit1 = output LCD-databus Bit 1 .equ DB0 = 0 ; PortC Bit0 = output LCD-databus Bit 0 ; Port
-
Datei
lcd_tools_dog.c
delay_ms(1); } /** @brief Enable Leitung togglen @param none @return none */ void lcd_flash_e (void) { PORTC = PORTC | ( 1<<DDC5 ) ; // Enable = HIGH delay(100); // kurz warten, damit Flanke entsteht PORTC = PORTC & ~( 1<<DDC5 ) ; // Enable = LOW delay(100); // Warten, bis der durch Enable angelegte Befehl
in „Kontrast EA DOG 162“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SAA1057.c
High for Init ??? (test) for(a=0;a<10;a++) // 10 Clock pulses for Init { for(b=0;b<10;b++) _NOP(); PORTC |=CLB; // CLB HIGH for(b=0;b<10;b++) _NOP(); PORTC &=~CLB; // CLB LOW } _NOP(); _NOP(); // (test) PORTA &=~DLEN; // (test) } //-------------------------------------- // SEND WORD TO PLL //---------
in „SAA1057 in Bascom Ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Inkrementalgeber-test2.cc
; } } void motor() { // Motor wird im rechtslauf für einen Schritt betrieben if (counter==1001) { PORTC=(1<<PC2); // Motor rechtslauf an _delay_ms(8); //8ms warten PORTC=(0<<PC2); // Motor rechtslauf aus } if (counter== -1) { PORTC=(1<<PC3); _delay_ms(8); //8ms warten PORTC=(0<<PC3); } } void motor_links() { // Motor wird im rechtslauf für einen Schritt betrieben PORTC=(1<<PC3); // Motor rechtslauf an _delay_ms(8); //8ms warten PORTC=(0<<PC3); // Motor rechtslauf aus } SIGNAL (SIG_OVERFLOW0) { // Timer overflow interrupt routine static char enc_last = 0x01; char
in „Drehrichtungsumkehr.Microcontroller Programm funzt nicht richtig.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.c
PORTA=0b00000000; // kein Pull-Up für A/D, Displayleitungen auf 0. DDRC= 0xFF; // alles Ausgänge PORTC=0x00; // und alle auf Null } void init_display(void) { _delay_ms(15); // Display muß nach dem Einschalten erst bereit sein PORTC=0b00111000; // Displayparameter (8bit, 2x8(!), 5x7); PORTA&=0b00011111
in „LCD will nicht funktionieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
rfm12_rx.c
spi_config(0xc4, 0x0f); /* AFC setting */ } int main(void) { ioinit(); radio_init(); /* LED test */ PORTC |= _BV(LED0); _delay_ms(500); PORTC |= _BV(LED1); _delay_ms(500); PORTC |= _BV(LED2); _delay_ms(500); PORTC |= _BV(LED3); _delay_ms(500); PORTC &= ~(_BV(LED0) | _BV(LED1) | _BV(LED2) | _BV(LED3)); for (;;) { /* LED blinken */ PORTC |= _BV(LED0); /* ??? PORTC ^= _BV(LED0); ! */ spi_xfr(0xb0); UDR = spi_xfr(0); while ((UCSRA & _BV(TXC)) == 0) { /* wait for transmission */ } /* * ??? du wartest auf RXC, das hat aber keinen Sinn,
in „Problem AM-Empfänger konstruieren“ · HF, Funk und Felder ·
-
Datei
sensorOnSpi.c
complete*/ SETBIT(PORTC,PC3);/*disaable seensor*/ } /*pooling write on SPI an 8 bit value*/ void writeSPI8(unsigned char data){ CLEARBIT(PORTC,PC3); /*enable sensor*/ SPDR = data; /*shift 8bits into MOSI MSB first*/ while(!(SPSR & (1<<SPIF))); /*wait for transmission complete*/ SETBIT(PORTC,PC3);/*disable sensor*/ } /*pooling reade on SPI*/ unsigned char readSensor(void){ CLEARBIT(PORTC,PC3); /*enable sensor*/ while(!(SPSR & (1<<SPIF))) /*wait for transmission complete*/ return SPDR;
in „avr gcc -sensor on SPI - Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
m8a_Pin-Test2.c
{ &DDRB, &PORTB, _BV(PB3) }, { &DDRB, &PORTB, _BV(PB4) }, { &DDRB, &PORTB, _BV(PB5) }, { &DDRC, &PORTC, _BV(PC0) }, { &DDRC, &PORTC, _BV(PC1) }, { &DDRC, &PORTC, _BV(PC2) }, { &DDRC, &PORTC, _BV(PC3) }, { &DDRC, &PORTC, _BV(PC4) }, { &DDRC, &PORTC, _BV(PC5) }, { &DDRD, &PORTD, _BV(PD0) }, { &DDRD, &
in „Atmega8A: loop über Ports/Pins funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
HOUR2.ASM
; ldi temp,PINSE ; zur Konfigurierung von Port B (PINSE=0b00111101) out ddrb,temp ; ser temp out portc,temp ;alle LEDs aus out portd,temp ;************* Programmstart ************ start: ;hier wird die erste Stelle mit einem E beschrieben ldi temp,Stelle1 ;gib Strom auf die erste Stelle out portc,temp
in „4433 bleibt bei rcall stehen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test_bas.c
include <stdlib.h> /* Cs Alias Portb.2 Sdi Alias Portb.3 Sdo Alias Pinb.4 Sck Alias Portb.5 Ptc5 Alias Portc.5 Ptc4 Alias Portc.4 */ //Dim D As Word uint16_t D; //Dim Data_in(10) As Byte uint8_t Data_in[10+1]; //Dim N As Byte uint8_t N; //Dim Timeout As Word uint16_t Timeout; //Dim T As Word uint16_t T; /
in „Code von Bascom nach C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcdadc.c
) PORTC=off; else { if (ledenable==1) PORTC=on; } if ((result0>=result2)&&(ledenable==1)) { PORTC=off; ledenable=0; } return ledenable; }//end P2 /*******************************Programm P3****************
in „undefinierter Rückgabewert“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Shiftin___mit_lcd.bas
Portb.2 = Input Config Lcd = 16 * 1 'LCD mit 16 zeichen und 2 Zeilen Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5 'verwendete Portpins für datenübertragung LCD Config Lcdbus = 4 Cls Cursor Off Do Shiftin Pinb.1 , Pinb.2 , Ergeb , 7
in „SHIFTOUT- Befehl in Bascom geht nicht“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
Messwertaufnahme.pdf
{ //----------------------successive approximation----------------------- int i; x=ACSR &(1<<5); PORTC=0; for (i=0;i<8;i++) { PORTC |= 0x80>>i; delay_us(20); if ((1<<5)&ACSR) PORTC &=~ (0x80>>i); } //----------------Darstellung der Spannung als Balkendiagramm auf dem LCD- Display----- if (x==0x20) { write_lcd(0,0x40); for(i=0;i<8;i++) { if(PORTC>i*32) patt[7-i]=0x1f; else {patt[7-i]=0;} } for(i=0;i<8;i++) write_lcd(1,patt[i]); write_lcd(0,0x8c); write_lcd(1,0); PORTC=0; // Referenzspannung zurücksetzen } PORTC++; // Referenzspannung erhöhen
in „AVR ATmega128 Messwertaufnahme“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
motorphasen.c
void phase_1(){ DDRC = 0b00011111; // --543210 // ABCABC PORTC = 0b00000110; // --543210 // ABCABC } void phase_2(){ DDRC = 0b00110111; // --543210 // ABCABC PORTC = 0b00000011; // --543210 // ABCABC } void phase_3(){ DDRC = 0b00110111; // --543210 // ABCABC PORTC = 0b00000101; // --543210 // ABCABC } void phase_4(){ DDRC = 0b00101111; // --543210 // ABCABC PORTC = 0b00000110; // --543210 // ABCABC } void phase_5(){ DDRC = 0b00101111; // --543210 // ABCABC PORTC = 0b00000011; // --543210 // ABCABC } void phase_6(){ DDRC = 0b00011111; // --543210 // ABCABC PORTC
in „ATmega 1284p Port C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
68HC11GR.ass
PORTA equ $00 68HC11GR.ASS 19.3.2000/26.10.2001 M. Glahe PIOC equ $02 parallel i/o controlregister PORTC equ $03 PORTB equ $04 PORTCL equ $05 portc latched data register DDRC equ $07 data direction register port c PORTD equ $08 DDRD equ $09 data direction register port d PORTE equ $0A analog eingaenge
-
Datei
68HC11GR.ass
PORTA equ $00 68HC11GR.ASS 19.3.2000/26.10.2001 M. Glahe PIOC equ $02 parallel i/o controlregister PORTC equ $03 PORTB equ $04 PORTCL equ $05 portc latched data register DDRC equ $07 data direction register port c PORTD equ $08 DDRD equ $09 data direction register port d PORTE equ $0A analog eingaenge
in „MC68HC11 MOPS 1.3e GLCD KS0108 Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
Poti 02...VCC...+4,5V 01...GND...Masse ********************************************/ void ehigh() { PORTC |= (1<<PC1); //EN auf High (noch bevor Datenrichtungsregister gesetzt ist) DDRC |= (1<<DDC1); //Ausgang } void elow() { PORTC &= ~(1<<PC1); //EN auf Low DDRC |= (1<<DDC1); //Ausgang } void enable()
in „Eigene Library für PLED-LCD-Ansteuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd_tools.c
delay_ms(1); } /** @brief Enable Leitung togglen @param none @return none */ void lcd_flash_e () { PORTC = PORTC | ( 1<<DDC5 ) ; // Enable = HIGH delay(100); // kurz warten, damit Flanke entsteht PORTC = PORTC & ~( 1<<DDC5 ) ; // Enable = LOW delay(100); // Warten, bis der durch Enable angelegte Befehl
in „LCD EAP204-4NLED funktioniert an Atmega16 W204B-NLW nicht??“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
4x4_keydebouncing_0.3.c
KEY1)) PORTC ^= 1<<1; // toggle if( get_key_press(1<<KEY2) || get_key_rpt(1<<KEY2)) PORTC ^= 1<<2; // toggle if(get_key_press(1<<KEY3)) PORTC ^= 1<<3; // toggle if(get_key_press(1<<KEY4)) PORTC ^= 1<<4; // toggle if(get_key_press(1<<KEY5)) PORTC ^= 1<<5; // toggle if(get_key_press(1<<KEY6)) PORTC ^= 1<<6; // toggle if(get_key_press(1<<KEY7)) PORTC ^= 1<<7; // toggle if(get_key_press(1<<KEY8)) PORTD ^= 1<<0; // toggle if(get_key_press(1<<KEY9
in „4x4 Matrixtastatur mit Tasterentprellung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Verteiler_Teststand.c
druecken"); lcd_setcursor(2,2); lcd_string(">Bauteil einfuegen"); do { if (Start1==1) { if (Start2==1) { PORTC=0x03; } else { // PORTC=0x00; // evt. lcd Felhermeldung z.b. Start1 drücken } } else { // PORTC=0x00; // evt. lcd Felhermeldung z.b. Start1 drücken } } while (PIND==0x00); lcd_clear(); lcd_setcursor
in „Icons löschen EA DIP203-6 (Atmega64)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
K2Settings = bit_clear_K2(0b01000000, K2Settings); K2Settings = bit_clear_K2(0b10000000, K2Settings); PORTC = 0x00; // Lösche PORTC PORTD = 0x00; // Lösche PORTD } void peripherie_LED(void) { K2Settings = bit_clear_K2(0b00000001, K2Settings); TRISC = 0x00; PORTC = 0x00; } void peripherie_NoLED(void) { K2Settings
in „PIC16F887 auf MC2V0 - I2C“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd_tools.c
delay_ms(1); } /** @brief Enable Leitung togglen @param none @return none */ void lcd_flash_e () { PORTC = PORTC | ( 1<<DDC5 ) ; // Enable = HIGH delay(100); // kurz warten, damit Flanke entsteht PORTC = PORTC & ~( 1<<DDC5 ) ; // Enable = LOW delay(100); // Warten, bis der durch Enable angelegte Befehl
in „LCD zeigt nichts an“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ATm48_Displaytest.asm
oberste KEY-Reihe (123) ; PB2 O E (Display) ; PB1 O RS (Display) ; Display .macro disp_d7_an sbi PORTC, 3 .endmacro .macro disp_d6_an sbi PORTC, 2 .endmacro .macro disp_d5_an sbi PORTC, 1 .endmacro .macro disp_d4_an sbi PORTC, 0 .endmacro .macro disp_d7_aus cbi PORTC, 3 .endmacro .macro disp_d6_aus cbi PORTC, 2 .endmacro .macro disp_d5_aus cbi PORTC, 1 .endmacro .macro disp_d4_aus cbi PORTC, 0 .endmacro .macro disp_en_an sbi PORTB, 2 .endmacro .macro disp_rs_an sbi PORTB, 1 .endmacro .macro disp_en_aus
in „Verzweifelt keine Anzeige am LCD“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
blinklicht.asm
mit Timer0 ; Datei: blinklicht.asm ; Autor: Sven Friedriszik ; Datum: 22.08.04 ; Aufgabe: Eine an PORTC 5 angeschlossene LED soll ; bei Interrupt von Timer0 wechseln .include "4433def.inc" .def temp=r16 .def counter=r17 .equ loops=32 .org 0x000 rjmp start .org 0x009 rjmp timer start: ldi temp, RAMEND
-
Datei
max187.c
MAX187_read(void) { int adc_value = 0; //12bit value from MAX87 int bit_count = 0; //Counter for bit PORTC |= (1<<CS); //CS inactive PORTC &=~(1<<CLK); //Reset CLK PORTC &=~(1<<CS); //CS activ _delay_us(9); for (bit_count = 0; bit_count < 13; bit_count ++) { PORTC |= (1<<CLK); //Set CLK adc_value = adc_value << 1; //shift left PORTC &=~(1<<CLK); //Reset CLK adc_value = adc_value + (PINC & 0b00000100); } PORTC |= (1<<CS); //CS inactive adc_value = adc_value >> 2; //shift right adc_value = (adc_value & 0x0fff); //only 12bits return
-
Datei
LichtschrankeLUKAS.c
void) { DDRD = 0x00; //Alle bits von PORTD als Eingang deklarieren PORTD = 0xff; // Alle Bits von PORTC auf 0 setzen DDRC = 0x00; //PORTC als Eingang uint8_t Player1 = 0; while(1) { if ((PIND & 0x02) != 1) //PIND2 ungleich 1 { _delay_ms(200); Player1 = Player1 +1; if (Player1 >= 4) { PORTC &= ~((1<<PINC5
in „AVR Atmega32 Probleme Eingang abfragen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
I2C_test.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 I2cinit dim Msb as byte dim Lsb as byte Dim
in „Wieder einmal Temperaturmessung mittels PT1000.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PPS5330_hack.c
); } // set I-Mess measurement if (mess_ch == I_Mess) { PORTC &= ~((1 << ADC_AD1) | (1<<ADC_AD2)); PORTC |= (1 << ADC_AD0); _delay_ms(50); } // set Temp1 for measurement if (mess_ch == T1_Mess) { PORTC &= ~(1<<ADC_AD2); PORTC |= (1 << ADC_AD0) | (1<<ADC_AD1); _delay_ms(50); } // set Temp2 for measurement if (mess_ch == T2_Mess) { PORTC &= ~((1<<ADC_AD0) | (1<<ADC_AD2)); PORTC |= (1<<ADC_AD1); _delay_ms(50); } // start ADC measurment PORTC |= (1 << ADC_AD2); PORTC &= ~((1 << ADC_AD0) | (1<<ADC_AD1)); // set busy for measurement busy_flag
in „PPS5330 Labor-Netzteil hack“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PPS5330_hack.c
; } // set I-Mess measurement if (mess_ch == I_Mess) { PORTC &= ~((1 << ADC_AD1) | (1<<ADC_AD2)); PORTC |= (1 << ADC_AD0); _delay_ms(50); } // set Temp1 for measurement if (mess_ch == T1_Mess) { PORTC &= ~(1<<ADC_AD2); PORTC |= (1 << ADC_AD0) | (1<<ADC_AD1); _delay_ms(50); } // set Temp2 for measurement if (mess_ch == T2_Mess) { PORTC &= ~((1<<ADC_AD0) | (1<<ADC_AD2)); PORTC |= (1<<ADC_AD1); _delay_ms(50); } // start ADC measurment PORTC |= (1 << ADC_AD2); PORTC &= ~((1 << ADC_AD0) | (1<<ADC_AD1)); // set busy for measurement busy_flag
in „PPS5330 Labor-Netzteil hack“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Inkrementalgeber_-_final.cc
{ // Zählen der Inkremente für Linksdrehung bis 1000. Impuls auf Ausgang PC2. if (links==1000) { PORTC=(1<<PC2); _delay_ms(8); //8ms warten links = 0; } // Zählen der Inkremente für Rechtsdrehung bis 1000. Impuls auf Ausgang PC3. if (rechts==1000) { PORTC=(1<<PC3); _delay_ms(8); //8ms warten rechts=
in „Drehrichtungsumkehr.Microcontroller Programm funzt nicht richtig.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
**********/ void ausgang_switcher_an() /******************************************************/ { PORTC=LATC | (1<<3); return; } /******************************************************/ void ausgang_switcher_aus() /******************************************************/ { PORTC=LATC &(~(1<<3)); return
in „PIC Port I/O mit HiTech C“ · Mikrocontroller und Digitale Elektronik ·