Suchergebnisse für "portc"
Thread
}; const uint8_t SEG_PC[] = { ... }; ... PORTA = (PORTA & ~SEG_PA_BITS) | SEG_PA[x]; PORTC = (PORTC & ~SEG_PC_BITS) | SEG_PC[x]; [/c]
Mikrocontroller und Digitale Elektronik
· Markus P.
· 01.05.2022 21:38
· 23 Antworten
Read_sensor1: Humidity1 = 0 Temperature1 = 0 Humsens_chksum = 0 Wait 3 Count = 1 Config Pinc.2 = Output : Portc .2 = 0 ' request data Waitms 20 ' wait 20 ms Config Pinc.2 = Input ' wait for data, receive data While Count < 43 ' collect 42 timings / signals Bitwait Pinc.2 , Set ' signal goes high > start timer
in
„2 Stk DHT 22 am Atmega?“
·
Mikrocontroller und Digitale Elektronik
·
26.04.2022 21:12
Thread
Humidityw = 0 Temperaturew = 0 Humsens_chksum = 0 Wait 3 Count = 1 Config Pinc.2 = Output : Portc .2 = 0 ' request data Waitms 20 ' wait 20 ms Config Pinc.2 = Input ' wait for data, receive data
Mikrocontroller und Digitale Elektronik
· Holger Z.
· 26.04.2022 22:02
· 9 Antworten
Thread
atmega328p der 7 WS2812 parallel ansteuert: [code] #define mask 0b01111111 #define ws2812_PORTREG PORTC #define ws2812_DDREG DDRC void ws2812_sendarray(uint8_t *data,uint16_t datlen) { uint8_t curbyte,ctr; while (datlen--) { curbyte=*data++; asm volatile ( "
Mikrocontroller und Digitale Elektronik
· Trulla O.
· 23.04.2022 10:51
· 28 Antworten
Thread
alle diesbezüglichen Einstellungen (single on RC2) korrekt gmacht zu haben. (Ausgang RC2 durch bsf PORTC ,2 überprüft). Dank für Hil im Voraus. Dieter
Mikrocontroller und Digitale Elektronik
· Dieter Kohtz
· 14.04.2022 15:47
· 2 Antworten
*********************************************************** init bank0 clrf PORTA clrf PORTB clrf PORTC bank1 movlw b'11111001' movwf TRISC ; RC1/2 = Ausgang (PWM) return ;****************************************************************** setpwm bank1 movlw 0xFF ; frequenzbestimmend movwf PR2 clrf PWM1CON
in
„PIC16F886 PWM-Programm läuft nicht“
·
Mikrocontroller und Digitale Elektronik
·
13.04.2022 18:18
Thread
CLK_CONFIG; WDT_RESET; PORTMUX_CONFIG; PORTA_CONFIG; // PORTB_CONFIG; // PORTC _CONFIG; TWI_CONFIG; //enable global interrupts sei(); } int main(void) { main_init(); while (1) { WDT_RESET; if (twi_received == TRUE) {
Mikrocontroller und Digitale Elektronik
· Ben S.
· 09.01.2024 11:55
· 4 Antworten
= 8; break; } case 16: { PORTC &= 0b11111100; PORTC |= 0b00000100; true_value = 16; break; } case 32: { PORTC &= 0b11111101; PORTC |= 0b00000101; true_value = 32; break; } default: { PORTC &= 0b11111000; true_value = 1; break; } } } else { switch (value) { case 2: { PORTC &= 0b11001111; PORTC |= 0b00001000; true_value = 2; break; } case 4: { PORTC &= 0b11010111; PORTC |= 0b00010000; true_value = 4; break; } case 8: { PORTC &= 0b11011111; PORTC |= 0b00011000; true_value
in
„Schrittmotoren ansteuern“
·
Mikrocontroller und Digitale Elektronik
·
21.03.2022 16:36
Thread
im Voraus. void main() { TRISC0 = 0; //Clearing this bit will make PORTC as output. PR2 = 100; // Set the Cycle time to 100 for varying the duty cycle from 0-100 CCP1CON = 0x0F; //configuring CCP1CON register for PWM mode
Mikrocontroller und Digitale Elektronik
· Mark J.
· 21.03.2022 16:44
· 1 Antworten
= 8; break; } case 16: { PORTC &= 0b11111100; PORTC |= 0b00000100; true_value = 16; break; } case 32: { PORTC &= 0b11111101; PORTC |= 0b00000101; true_value = 32; break; } default: { PORTC &= 0b11111000; true_value = 1; break; } } } else { switch (value) { case 2: { PORTC &= 0b11001111; PORTC |= 0b00001000; true_value = 2; break; } case 4: { PORTC &= 0b11010111; PORTC |= 0b00010000; true_value = 4; break; } case 8: { PORTC &= 0b11011111; PORTC |= 0b00011000; true_value
in
„Schrittmotoren ansteuern“
·
Mikrocontroller und Digitale Elektronik
·
18.03.2022 16:36
Signalvergleich Sinus Positiv if(l<800) { if (D[n] < val*S[m]) { //Dreiecksignal kleiner als Sinussignal bitSet(PORTC , 6); //Pin 5 HIGH } else { //Dreiecksignal größer als Sinussignal bitClear(PORTC , 6); //Pin 5 LOW } if (D[n] < val*S[m]) { //Dreiecksignal kleiner als Sinussignal bitSet(PORTD, 7); //Pin 6 HIGH } else
in
„Arduino Micro char array Wert negieren“
·
Mikrocontroller und Digitale Elektronik
·
14.03.2022 11:44
rows //********************************************************************** #define GLCD_DATAPORT PORTC //Port für GLCD Data Pins #define GLCD_DATAPORTDDR DDRC//DDR für Data Pins #define GLCD_RESETPORT PORTA//Port für Reset #define GLCD_RESETPORTDDR DDRA//DDR für Reset #define GLCD_RESETPIN 4//Pin für
in
„EA DIP 122-5 mit SED1520: Kann Page 2 nicht ansprechen“
·
Mikrocontroller und Digitale Elektronik
·
13.03.2022 19:34
Thread
/Signalvergleich if (D[n] < val*S[m]) { //Dreiecksignal kleiner als Sinussignal bitSet(PORTC , 6); //Pin 5 HIGH } else { //Dreiecksignal größer als Sinussignal bitClear(PORTC , 6); //Pin 5 LOW } if (D[n] < val*S[m]) { //Dreiecksignal
Hallo Black D, beim Arduino Micro wird der Arduino-Pin D5 über PORTC 6 angesteuert und der Arduino-Pin D6 über PORTD7. Beim Arduino Mega 2560 sind aber für den Arduino-Pin D5 PORTE3 und für D6 PORTH3 zuständig. Siehe die Dateien "pins_arduino.h" in den Ordnern C:\Program
Mikrocontroller und Digitale Elektronik
· Black D.
· 11.03.2022 14:33
· 13 Antworten
Thread
Timer-Vergleichs-Interrupt } ISR(TIMER1_COMPA_vect){ // Interrupt if (D[n] < val*S[m]) { bitSet(PORTC , 6); // Pin 5 HIGH } else { bitClear(PORTC , 6); // Pin 5 LOW } if (D[n] < val*S[m]) { bitSet(PORTD, 7); // Pin 6 HIGH } else { bitClear(PORTD, 7); // Pin 6 LOW } n=n+1; if(n>15) n=0;
Sinus Positiv if (D[n] < val*Sinus) { //Dreiecksignal kleiner als Sinussignal bitSet(PORTC , 6); //Pin 5 HIGH bitSet(PORTD, 7); //Pin 6 HIGH } else { //Dreiecksignal größer als Sinussignal bitClear(PORTC , 6); //Pin
Mikrocontroller und Digitale Elektronik
· Black D.
· 12.08.2025 13:39
· 38 Antworten
Thread
; void USART1_sendChar(char c); void USART1_sendString(char *str); void USART1_init(void) { PORTC .DIR &= ~PIN1_bm; PORTC .DIR |= PIN0_bm; USART1.BAUD = (uint16_t)USART1_BAUD_RATE(9600); USART1.CTRLB |= USART_TXEN_bm; } void USART1_sendChar(char c) { while (!(USART1.STATUS & USART_DREIF_bm
Mikrocontroller und Digitale Elektronik
· Georg M.
· 01.03.2022 13:25
· 3 Antworten
PD4 LED_Gruen Alias PortC.0 ' LED Grün an PD3 Config Twi = 100000 ' I2C Takt = 100 KHz Config SCL = Portc .4 Config SDA = Portc .5 I2cinit Config Lcdpin = Pin , Db4 = PortD.4 , Db5 = PortD.5 , Db6 = PortD.6 , Db7 = PortD.7 , E = PortD.3 , Rs = PortD.2 Config Lcd = 16x2 Cls Cursor Off Waitms 100 Dim Slaveadresse
in
„1602 LCD mit ATmega8535 und Bascom läuft nicht“
·
Mikrocontroller und Digitale Elektronik
·
27.02.2022 19:05
Thread
"lcd4busy.LBX" $regfile = "m8535.dat" $crystal = 8000000 Config Lcd = 16*2 Const _lcdport = Portc Const _lcdddr = Ddrc Const _lcdin = Pinc Const _lcd_e = 1 Const _lcd_rw = 2 Const _lcd_rs = 3 Cls Locate 1,1 Lcd "Es funktioniert!" [/c] Karl B. schrieb im Beitrag #6988802: Angehängte
LCD Display konfigurieren ' Config Lcdbus = 4 ' LCD 4 Bit Modus Config Lcdpin = Pin , Db4 = Portc .4 , Db5 = Portc .5 , Db6 = Portc .6 , Db7 = Portc .7 , E = Portc .3 , Rs = Portc .2 Config Lcd = 40x2 ' Display 40 Zeichen 4 Zeilen Cursor off Noblink CLS ' 'I2C konfigurieren ' $lib "i2c_twi.lbx
Mikrocontroller und Digitale Elektronik
· Tim D.
· 09.03.2022 12:55
· 158 Antworten
0xFF #define BTDEBUG 0 // Original KeySave Meiner #define BT_EN_REGISTER DDRC #define BT_EN_PORT PORTC #define BT_EN_PIN PC5 #define BT_RTX_PORT PORTD #define BT_TRX_REG DDRD #define BT_RX_PIN PD0 #define BT_TX_PIN PD1 #define LED_REGISTER DDRC #define LED_PORT PORTC #define LED_RED_PIN PC0 #define LED_GREEN_PIN PC1 #define LED_BLUE_PIN PC2 // Board /* #define BT_EN_REGISTER DDRC #define BT_EN_PORT PORTC #define BT_EN_PIN PC0 #define BT_RTX_PORT PORTD #define BT_TRX_REG DDRD #define BT_RX_PIN PD0 #define BT_TX_PIN PD1 #define LED_REGISTER DDRC #define LED_PORT PORTC #define LED_RED_PIN PC5 #define
in
„ATMEGA88V BOD 1,8V Reset HC05“
·
Mikrocontroller und Digitale Elektronik
·
23.02.2022 17:50
Thread
TCNT0 = 0; TCCR0B = (1<<CS02); // start timer0; prescaler=256; 1 tick = 12.8 µs; OVF 3.28ms PORTC &= ~(1<<PORTC 0); } int main(void) { DDRB = (1<<PORTB6); // set MISO as output; all other PINs remain inputs SPCR = (1<<SPE) | (1<<SPIE) | (1<<CPOL) | (1<<CPHA); DDRC = (1<<PORTC 0) | (1<<PORTC 1); // outputs for test signals sei(); while (1) { if(TCNT0>35) { // last SPI telegram is definitely over (msg every 10ms), so reset byte counter PORTC |= (1<<PORTC 1
Mikrocontroller und Digitale Elektronik
· Nils
· 24.02.2022 17:26
· 20 Antworten
=0xFF; TCCR0B = (1<<CS01); TIMSK0 |= (1<<TOIE0); sei(); while(1){ PORTD=sekunden; PORTA=stunden; PORTC =minuten; } } ISR( TIMER0_OVF_vect ) { help++; if(help==62&&last==1){ updateTime(); help=0; last=0; } if(help==63&&last==0){ updateTime(); help=0; last=1; } }
in
„Atmega1284p 128KHz ungenau“
·
Mikrocontroller und Digitale Elektronik
·
19.02.2022 14:13
Thread
Dann versuch es doch mal so: PORTD = sekunden; PORTA = sekunden; PORTC = sekunden;
PORTC 2..5 wird von JTAG benutzt - ist das abgeschaltet?
Mikrocontroller und Digitale Elektronik
· David P.
· 19.02.2022 16:22
· 42 Antworten
Thread
wieviele Takte die ISR ca braucht? [c] ISR(TIMER1_COMPA_vect) { cli(); Schrittzaehler++; PORTC &= ~(1<<PC1); // PWM-Ausgang if(sflags & (1<<rampe_aktiv)) // Solange eine Rampe gefahren wird { if(sflags & (1<<beschleunigungsrampe)) /
Mikrocontroller und Digitale Elektronik
· Andre
· 14.02.2022 12:04
· 30 Antworten
available, the 10-pin "squid" cable can also be used to connect directly to the device's JTAG port on PORTC [5::2] of the STK500. Connecting to debugWIRE and SPI targets is done using the 6-pin 100 mil adapter. When using the debugWIRE interface, be sure to remove the STK500's RESET jumper to allow the reset
in
„Arduino Nano über ISP programmieren“
·
Mikrocontroller und Digitale Elektronik
·
13.02.2022 16:02
Thread
endif} // {$if defined (ATMega16)}SBI 21, LED // 21 = PORTC // ldi r16, 13 // {$endif} {$if defined (ATMega328p)} sbi 8, LED_01 // 8 = PortC (ATMega328p) sbi
Mikrocontroller und Digitale Elektronik
· Vam L.
· 14.02.2022 15:17
· 2 Antworten
); PORTC = mpx_buffer[1]; MPX_DIG1(); _delay_us(100); MPX_ALL_OFF(); _delay_us(1); PORTC = mpx_buffer[9]; MPX_DIG9(); _delay_us(100); MPX_ALL_OFF(); _delay_us(1); PORTC = mpx_buffer[2]; MPX_DIG2(); _delay_us
in
„7 Segment Anzeige auf verschiedenen Ports“
·
Mikrocontroller und Digitale Elektronik
·
10.02.2022 22:34
Thread
Pin A5 } } void led_taster2(int taster2) { if(taster2==1) { PORTC &= ~(1<<PC5); // Schaltet Pin PORTC |= (1<<PC6); // Schaltet Pin } else { PORTC |= (1<<PC5); // Schaltet Pin PORTC &= ~(1<<PC6); // Schaltet
Mikrocontroller und Digitale Elektronik
· Henry
· 11.02.2022 12:51
· 104 Antworten
Thread
half of the display { PORTC = i; PORTG = PORTG & 0b11111011; //Set RS to 0 PORTG = PORTG | 0b00000001; //set E2 to 1 _delay_ms(2); PORTG = PORTG & 0b11111110; //set E2 to 0 } /********************************
. Das > Ding dürfte nicht ohne Warnings compilieren. Was? Erste Zeile in den Funktionen: PORTC = i; Das ist nicht "nichts damit machen" ...
Mikrocontroller und Digitale Elektronik
· Andre G.
· 31.01.2022 15:49
· 26 Antworten
, SS ; SD-Card ; ; Activate Pull-Up for CD and WP of SD-Card slot ; ldi r18, PORT_PULLUPEN_bm sts PORTC _PIN2CTRL, r18 sts PORTC _PIN3CTRL, r18 ; ; Alternate PINs for SPI1 ; ldi r18, PORTMUX_SPI1_ALT1_gc; SPI1 on PC4..7 sts PORTMUX_SPIROUTEA, r18 ;-------------------------------------------------------
in
„AVR Level1 Interrupt“
·
Mikrocontroller und Digitale Elektronik
·
21.01.2022 09:33
zwar erreicht waitMs(250); // aber nochmals den Zylinder drucklos machen PORTC =0; waitMs(100); PORTC =1; // Ausgang 1 Ventil Scharnier zu waitMs(2000); PORTC =0; waitMs(10); PORTC =16; // Ausgang 16 Freigabe Absaugung ein } // Ende 1 Klappe ist normal zugegangen else { do { PORTC
in
„Brauche Hilfe AT Mega 8 im Raum Bremen evlt. vor Ort“
·
Mikrocontroller und Digitale Elektronik
·
19.01.2022 21:46
Thread
Beitrag #6948396: > Such mal nach "Mega Pro Mini" Nicht wirklich was ich mir vorgestellt habe. PORTC zum Beispiel ist da auch etwas verwurstelt herausgeführt. Schön wäre ein Board bei dem wirklich jeder Port eine eigene Buchsenleiste hat (inklusive GND und Vcc) Oder bei einer doppelten Buchsenleiste
Mikrocontroller und Digitale Elektronik
· Andre G.
· 19.01.2022 14:46
· 12 Antworten
Thread
F_CPU 8000000UL int main(void) { DDRC |=(1<<PC0); while (1) { PORTC |=(1<<PC0); _delay_ms(1000); PORTC &= ~(1<<PC0); _delay_ms(1000); } }
Mikrocontroller und Digitale Elektronik
· Chris C.
· 13.01.2022 12:40
· 8 Antworten
Thread
main-Funktion uint8_t i = 2; i_verdoppeln (i); // Aufruf der i_verdoppeln-Funktion PORTC = i; // den Wert von i auf Port C ausgeben, hier i = 4 } return 0; [/c]
main-Funktion uint8_t i = 2; i_verdoppeln (i); // Aufruf der i_verdoppeln-Funktion PORTC = i; // den Wert von i auf Port C ausgeben, hier i = 4 } return 0; [/c] Das AVR-Studio (GCC) kann, glaube ich, C, C++ und irgendwelche Sondersachen. (ist C nicht sowieso Teilmenge von Cpp?)
Mikrocontroller und Digitale Elektronik
· Fabian H.
· 13.01.2022 00:05
· 9 Antworten
0; /* no prescaler */ TWBR = ((F_CPU/SCL_CLOCK)-16)/2; /* must be > 10 for stable operation */ // PORTC |= (1 << PORTC 5 | 1<< PORTC 4); //internal pullop? printf("TWI initialized \n"); }/* i2c_init */ /************************************************************************* Issues a start condition and
in
„Atmega328p + AS7261 I2C kein Ack vom slave“
·
Mikrocontroller und Digitale Elektronik
·
12.01.2022 11:29
ADXL345_I2C_H_ #define ADXL345_I2C_H_ #include <avr/io.h> #include <util/delay.h> #define SCLPORT PORTC //TAKE PORTD as SCL OUTPUT WRITE #define SCLDDR DDRC //TAKE DDRB as SCL INPUT/OUTPUT configure #define SDAPORT PORTC //TAKE PORTD as SDA OUTPUT WRITE #define SDADDR DDRC //TAKE PORTD as SDA INPUT configure
in
„I2C-Bibliothek für ATMEGA88A“
·
Mikrocontroller und Digitale Elektronik
·
05.01.2022 18:39
ADXL345_I2C_H_ #define ADXL345_I2C_H_ #include <avr/io.h> #include <util/delay.h> #define SCLPORT PORTC //TAKE PORTD as SCL OUTPUT WRITE #define SCLDDR DDRC //TAKE DDRB as SCL INPUT/OUTPUT configure #define SDAPORT PORTC //TAKE PORTD as SDA OUTPUT WRITE #define SDADDR DDRC //TAKE PORTD as SDA INPUT configure
in
„ATMEGA88A/Beschleunigungssensor (ADXL345)“
·
Mikrocontroller und Digitale Elektronik
·
03.01.2022 19:34
Thread
richtig konfiguriert. Aktuell verstehe ich das so -> [c] /* * SYSCFG->EXTICR[0] = PORTA0, PORTB0, PORTC 0, PORTD0, PORTF0 * SYSCFG->EXTICR[1] = PORTA1, PORTB1, PORTC 1, PORTD1, PORTF1 * SYSCFG->EXTICR[2] = PORTA2, PORTB2, PORTC 2, PORTD2, PORTF2 * SYSCFG->EXTICR[3] = PORTA3, PORTB3, PORTC 3, PORTD3, PORTF3
Mikrocontroller und Digitale Elektronik
· Jan H.
· 02.01.2022 16:08
· 18 Antworten
if(a == eS_PORTB6) PORTB &= ~(1<<PB6); else if(a == eS_PORTB7) PORTB &= ~(1<<PB7); else if(a == eS_PORTC 0) PORTC &= ~(1<<PC0); else if(a == eS_PORTC 1) PORTC &= ~(1<<PC1); else if(a == eS_PORTC 2) PORTC &= ~(1<<PC2); else if(a == eS_PORTC 3) PORTC &= ~(1<<PC3); else if(a == eS_PORTC 4) PORTC &= ~(1<<PC4);
in
„LCD Initialisierung funktioniert nicht“
·
Mikrocontroller und Digitale Elektronik
·
30.12.2021 19:19
Thread
Im Anhang sieht man wo ich im Ablauf stehe und unten ist das SFR-Register zu sehen was sich bei PORTC hätte ändern müssen!? Woran könnte das liegen das hier nichts reagiert? Gruß André
Mikrocontroller und Digitale Elektronik
· Rudi R.
· 28.12.2021 20:53
· 0 Antworten
|=(1<<3); // Ausgang 3 Ventil Klappe zu waitMs(500); PORTC &= ~(1<<3); waitMs(200); PORTC |=(1<<3); waitMs(50); PORTC &= ~(1<<3); waitMs(50); PORTC |=(1<<3); waitMs(50); PORTC &= ~(1<<3); waitMs(50); PORTC |=(1<<0); // Ausgang 0 Ventil Scharnier zu waitMs(
in
„Brauche Hilfe AT Mega 8 im Raum Bremen evlt. vor Ort“
·
Mikrocontroller und Digitale Elektronik
·
22.12.2021 15:21
Thread
Als ERSTE Maßname würde ich den Code etwas straffen. Oft erkennt man Sequenzen wie [c] PORTC =4; waitMs(500); PORTC =0; waitMs(200); [/c] Hier soll wohl das Ventil 4 für 500ms betätigt werden. Wieso schreibts du hier nicht [c] ventil(4, 500); waitMs(200); [/c] und definierst dir eine Funktion [c] void ventil(int ventil_nr, int dauer) { PORTC = ventil_nr; waitMs(dauer); PORTC = 0; } [/c] in deinem Code steht dann [c] ventil(4, 500); waitMs(200); [/c] Der Programmcode reduziert sich damit auf ca. die Hälfte - und
Mikrocontroller und Digitale Elektronik
· Darko D.
· 14.12.2022 18:35
· 334 Antworten
Werk mit aktiviertem JTAG-Interface ausgeliefert. Dieses Interface belegt vier Port-Pins (z. B. am PORTC bei ATmega16/32), die nicht für eigene Anwendungen genutzt werden können, solange das JTAG-Interface aktiviert ist. Das Interface lässt sich über ein Fuse-Bit (JTAGEN) dauerhaft und über ein Bit (JTD
Artikel
· 20.12.2021 08:10
Thread
was OUT sein soll, obwohl es mich wundert, woher der Compiler wissen soll, ob PortA, PortB, oder PortC gemeint sind. >> pinMode(4,OUTPUT); Relais??? >> pinMode(2,INPUT); IR-Receiver??? aber weiß das damit auch deine IR-Library?? >> case 0xFFA25D: digitalWrite(4,HIGH); Soll das die Relais-Ausgabe
Mikrocontroller und Digitale Elektronik
· Lukas G.
· 14.12.2021 19:21
· 34 Antworten
Thread
31]=0xFF; //display[32][16]=0x0F; //HAL_GPIO_WritePin(GPIOG, GPIO_PIN_1, GPIO_PIN_SET); //PORTC |= (1<<OE); for(uint8_t line=0;line<=15;line++) { //HAL_GPIO_WritePin(GPIOG, GPIO_PIN_1, GPIO_PIN_SET); //PORTC |= (1<<OE); for(uint8_t pos = 128; pos>=1; pos--)
//Ein"latchen" Strobe der Reihe //HAL_GPIO_WritePin(GPIOG, GPIO_PIN_0, GPIO_PIN_RESET);//PORTC &= ~(1<<PC5); HAL_GPIO_WritePin(GPIOG, GPIO_PIN_0, GPIO_PIN_SET); //PORTC |= (1<<PC5); HAL_GPIO_WritePin(GPIOG, GPIO_PIN_0, GPIO_PIN_RESET);//PORTC &= ~(1<<PC5); HAL_GPIO_WritePin
Mikrocontroller und Digitale Elektronik
· Johannes M.
· 27.11.2021 17:00
· 2 Antworten
Thread
Zur Ergänzung: PORTC .DIR |= PIN6_bm; führt zum gleichen Ergebnis wie PORTC .DIRSET = PIN6_bm; nur das der Compiler das erstere in 3 Anweisungen (Read/Mod/Write) übersetzt, während unten nur 1 Anweisung (plus evtl.
Mikrocontroller und Digitale Elektronik
· Lars H.
· 17.11.2021 19:49
· 10 Antworten
Thread
lds r2, 0b00000100 ; PORTB - PIN 2 lds r3, 0b00001000 ; PORTB - PIN 3 lds r4, 0b00000001 ; PORTC - PIN 0 ; /Bitmuster laden Ende Start_Scan: sbi PORTB, 0 ; Erste Reihe (1, 2, 3, A) auf high setzen nop nop nop in r19, PINB ; Status vom Port einlesen and r19, r1 ; Nur wenn
lds r2, 0b00000100 ; PORTB - PIN 2 lds r3, 0b00001000 ; PORTB - PIN 3 lds r4, 0b00000001 ; PORTC - PIN 0 [/code] ersetzen mit: [code] .EQU Spalte0 = 0x01 ; Tasten an PINC.1 .EQU Spalte1 = 0x02 ; .EQU Spalte2 = 0x04 ; .EQU Spalte3 = 0x08 ; .EQU AnyKey = 0x0E ; Irgendeine Taste an PINB.1
Mikrocontroller und Digitale Elektronik
· BaeumeKommunizierenElektromagnetisch
· 14.11.2021 18:09
· 4 Antworten
Pins bit 5 .equ PINB6 = 6 ; Port B Input Pins bit 6 .equ PINB7 = 7 ; Port B Input Pins bit 7 ; ***** PORTC ************************ ; PORTC - Port C Data Register .equ PORTC 0 = 0 ; Port C Data Register bit 0 .equ PC0 = 0 ; For compatibility .equ PORTC 1 = 1 ; Port C Data Register bit 1 .equ PC1 = 1 ; For compatibility .equ PORTC 2 = 2 ; Port C Data Register bit 2 .equ PC2 = 2 ; For compatibility .equ PORTC 3 = 3 ; Port C Data Register bit 3 .equ PC3 = 3 ; For compatibility .equ PORTC 4 = 4 ; Port C Data Register bit 4 .equ PC4
in
„ATMega16 mehrere Taster an INT0“
·
Mikrocontroller und Digitale Elektronik
·
13.11.2021 09:14
#define DDC2 2 #define DDC3 3 #define DDC4 4 #define DDC5 5 #define DDC6 6 #define DDC7 7 #define PORTC _SFR_IO8(0x15) #define PC0 0 #define PC1 1 #define PC2 2 #define PC3 3 #define PC4 4 #define PC5 5 #define PC6 6 #define PC7 7 #define PINB _SFR_IO8(0x16) #define PINB0 0 #define PINB1 1 #define PINB2
in
„ATMega16 mehrere Taster an INT0“
·
Mikrocontroller und Digitale Elektronik
·
11.11.2021 21:08
PORTC 1 #endif #if defined(PC2) && !defined(PORTC 2) # define PORTC 2 PC2 #elif defined(PORTC 2) && !defined(PC2) # define PC2 PORTC 2 #endif #if defined(PC3) && !defined(PORTC 3) # define PORTC 3 PC3 #elif defined
in
„ATMega16 mehrere Taster an INT0“
·
Mikrocontroller und Digitale Elektronik
·
11.11.2021 20:52
#define DDC1 1 #define DDC2 2 #define DDC3 3 #define DDC4 4 #define DDC5 5 #define DDC6 6 #define PORTC _SFR_IO8(0x08) #define PORTC 0 0 #define PORTC 1 1 #define PORTC 2 2 #define PORTC 3 3 #define PORTC 4 4 #define PORTC 5 5 #define PORTC 6 6 #define PIND _SFR_IO8(0x09) #define PIND0 0 #define PIND1 1 #define
in
„ATMega16 mehrere Taster an INT0“
·
Mikrocontroller und Digitale Elektronik
·
11.11.2021 20:51
<avr/pgmspace.h> #include "bits.h" // All of port B is address. // All of port D is data. #define PORTC _ICONT 2 #define PORTC _nDBE 4 #define PORTC _POLL 5 #define PORTC _nASR 6 #define PORTC _ADV 7 #define EP0_SIZE 64 void setup_delay() { for (volatile uint16_t i = 0; i < 9; ++i) { asm volatile("nop");
in
„AT90USB162 Endpoint Interrupts funktionieren nicht“
·
Mikrocontroller und Digitale Elektronik
·
11.11.2021 20:01