Suchergebnisse für "portc"
Thread
e.g. 1 second cli(); // configure input pins DDRC = 0x00; // set port C as input PORTC = 0xff; // enable internal pullups // setup timer for sampling TCCR1A = 0; TCCR1B = 0; TCNT1 = 0; // initialise counter with 0 OCR1A = (16000000.0/(sample_rate*2))-1.0; // (needs
Mikrocontroller und Digitale Elektronik
· Lukas Bommes
· 20.09.2016 10:54
· 10 Antworten
Thread
include <util/delay.h> #include <stdbool.h> #include <avr/io.h> #define led (1<<PC0) #define ein PORTC |= #define aus PORTC &= ~ bool tastergedrueckt = true; int main(void) { DDRC = (1<<PC0); PORTD =(1<<PD0); void ledblink() { PORTC |= (1<<PC0); _delay_ms(400); PORTC &= ~(1<<PC0); _delay_ms(400); PORTC |= (1<<PC0); _delay_ms(400); PORTC &= ~(1<<PC0); _delay_ms(400); } while(1) { if (!(PIND&(1<<PD0))) { _delay_ms(300); tastergedrueckt
Mikrocontroller und Digitale Elektronik
· Huber M.
· 23.09.2016 21:30
· 63 Antworten
Thread
1]*w[1]-a[2]*w[2]; y=b[0]*w[0]+b[1]*w[1]+b[2]*w[2]; //w[2]=w[1]; //w[1]=w[0]; PORTC =y; _delay_ms(1); } }[/c] Koeffizienten habe ich mit Matlab (fdatool) ausgerechnet.
Daniel R. schrieb im Beitrag #4718672: > PORTC =y; Schau dir mal an, wie ein float intern im AVR representiert wird und was passiert, wenn man das ohne jedes Casting auf einen 8-Bit Port schreibt. Da kann nichts vernünftiges bei passieren. Du
Mikrocontroller und Digitale Elektronik
· Daniel Bechter
· 14.09.2016 08:32
· 5 Antworten
m328def.dat" $crystal = 8000000 $hwstack = 50 $swstack = 50 $framesize = 100 'I2C config Config Sda = Portc .0 Config Scl = Portc .1 'UART config Config Com1 = 9600 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Open "com1:" For Binary As #1 '**********************************
in
„BME280 Beispiel Code in BASCOM“
·
Projekte & Code
·
10.09.2016 23:33
Thread
<< PC3 ) | ( 1 << PC4 ) | ( 1 << PC5 ); // PB0 bis PB5 Stepper-Interface (arduino 32 bis 37) PORTC |= ( 1 << PC0 ) | ( 1 << PC1 ); // Disable Stepper DDRE &= ~( 1 << PE4 ); // Tacho-Input for Motor-Fan PORTE |= ( 1 << PE4 ); // Enable Pullup EICRB |= ( 1 << ISC40); // Any
Mikrocontroller und Digitale Elektronik
· Marcel Peterkau
· 10.09.2016 16:08
· 13 Antworten
Thread
Ich glaube, die portc -pins als ausgang zu konfigurieren, hilft deinem vorhaben auch nicht so richtig nach vorn. Lass die portc -pins mal auf eingang.
Gcc schrieb im Beitrag #4714546: > Ich glaube, die portc -pins als ausgang zu konfigurieren, hilft deinem > vorhaben auch nicht so richtig nach vorn. Lass die portc -pins mal auf > eingang. stimmt, abgeändert, keine Funktion. jetzt weiß ich nicht mehr
Mikrocontroller und Digitale Elektronik
· Huber M.
· 11.09.2016 15:45
· 74 Antworten
Thread
Fußnote doch eher drauf an, was *nachher* drinstand und nicht vorher?!? Also: PORTA = PORTB = PORTC = 0xFF; wurde vor der Draft-Änderung interpretiert als: PORTC = 0xFF; PORTB = PORTC ; PORTA = PORTB; Also: Was jeweils genommen wurde, war der Wert *nach* der vorhergehenden Zuweisung. Nach der Änderung von gcc funktioniert das nun so: PORTC = 0xFF; PORTB = 0xFF; PORTA = 0xFF; ... jedenfalls habe ich es so verstanden.
Mikrocontroller und Digitale Elektronik
· Micha
· 27.09.2016 10:27
· 46 Antworten
; } else { PORTD &= ~(1<<pinD0); } */ PORTD = data; } void writeDisp(uint8_t data, uint8_t cmd) { PORTC &= ~(1<<pinRW) | (1<<pinCS) | (1<<pinDC); // lösche Bit R/W, /CS und D/C _delay_us(100); // wenn COMMAND if (cmd == 1) { // lösche Bit DC PORTC &= ~(1<<pinDC); } else { PORTC |= (1<<pinDC); } setData(data); PORTC |= (1<<pinE); // setze Bit E _delay_us(100); PORTC &= ~(1<<pinE); _delay_us(100); PORTC |= (1<<pinRW); PORTC |= (1<<pinDC); _delay_us(100); } void initalize() { _delay_ms(10); PORTC &= ~(1<<pinRES)
in
„AVR Mega1284, Fontarray zu groß -> wie in Flash?“
·
Mikrocontroller und Digitale Elektronik
·
08.09.2016 22:06
///////////////////// #define REG_NR_BUT_UP 4 #define PIN_REG_BUT_UP PINC #define PORT_REG_BUT_UP PORTC #define DIR_REG_BUT_UP DDRC #define REG_NR_BUT_DOWN 1 #define PIN_REG_BUT_DOWN PINC #define PORT_REG_BUT_DOWN PORTC #define DIR_REG_BUT_DOWN DDRC #define REG_NR_BUT_LEFT 2 #define PIN_REG_BUT_LEFT PINC #define PORT_REG_BUT_LEFT PORTC #define DIR_REG_BUT_LEFT DDRC #define REG_NR_BUT_RIGHT 5 #define PIN_REG_BUT_RIGHT PINC #define PORT_REG_BUT_RIGHT PORTC #define DIR_REG_BUT_RIGHT DDRC #define REG_NR_BUT_ENTER 3 #define PIN_REG_BUT_ENTER
in
„Funkuhr+Wecker“
·
Projekte & Code
·
06.09.2016 19:46
Thread
/PORTC #define led11 0b00000100 //PORTB #define led12 0b10000000 //PORTB #define led13 0b00001000 //PORTA #define led14 0b01000000 //PORTC #define led15 0b00000010 //PORTC #define led16 0b00001000 /
/PORTC #define led11 0b00000100 //PORTB #define led12 0b10000000 //PORTB #define led13 0b00001000 //PORTA #define led14 0b01000000 //PORTC #define led15 0b00000010 //PORTC #define led16 0b00001000 /
Mikrocontroller und Digitale Elektronik
· Nikan
· 03.09.2016 02:39
· 4 Antworten
count==12) { count=0; DATA_CLR; } else { DATA_SET; } // altes Zeilenmuster löschen PORTB &= ~0x03; PORTC &= ~0x0F; PORTD &= ~0xF0; // Spalten-Mux einen Takt weiter schieben CLK_SET; CLK_CLR; // neues Muster lesen spalte=led[count]; // neues Muster ausgeben PORTB |=(spalte >> 8) & 0x03; PORTC |=spalte
in
„ATMEGA8(Pong) - Grundsatzfrage bzgl. Überschreiben des alten Zustands der LED“
·
Mikrocontroller und Digitale Elektronik
·
01.09.2016 13:06
count++; if (count==12) { count=0; DATA_CLR; } else { DATA_SET; } CLK_SET; CLK_CLR; PORTB &= ~0x03; PORTC &= ~0x0F; PORTD &= ~0xF0; STROBE_SET; STROBE_CLR; spalte=led[count]; PORTB |=(spalte >> 8) & 0x03; PORTC |=spalte & 0x0F; PORTD |=spalte & 0xF0; } int main(void) { //int16_t Zeile; sekunden=50; minuten
in
„ATMEGA8(Pong) - Grundsatzfrage bzgl. Überschreiben des alten Zustands der LED“
·
Mikrocontroller und Digitale Elektronik
·
01.09.2016 09:36
Thread
// Asynchron 8N1 ist bei mega 168 default UBRR0 = 129; // Pullups für Hall Sensoren PORTC |= 0b00111000; char sensor[200]; uint8_t sensorold = 0; uint8_t sensorbin = 0; while (1){ sensorbin = 0; if ( PINC & (1<<PINC5) ) { sensorbin
Mikrocontroller und Digitale Elektronik
· Martin W.
· 01.09.2016 14:15
· 57 Antworten
for the white or fourth channel /*---Define the states of the LED's (on/off)---*/ #define LED_R_ON PORTC |= (1<<PC4); #define LED_R_OFF PORTC &= ~(1<<PC4); #define LED_G_ON PORTC |= (1<<PC3); #define LED_G_OFF PORTC &= ~(1<<PC3); #define LED_B_ON PORTC |= (1<<PC2); #define LED_B_OFF PORTC &= ~(1<<PC2); //#define LED_W_ON PORTC |= (1<<PC1); //Again for the 4. channel / white //#define LED_W_OFF PORTC &= ~(1<<PC1); //Again for the 4. channel / white /*---DIP-Settings for DMX Adressing (1-256)---*/ #define PD_IN DDRD &= ~(
in
„DMX und der Attiny2313“
·
Mikrocontroller und Digitale Elektronik
·
27.08.2016 12:28
; !!Bank Program-Page-Select LADR_0x03B0 BCF PCLATH,3 ; !!Bank Program-Page-Select BCF PORTC ,6 ; !!Bank!! PORTC - TRISC - CM1CON0 - BAUDCTL BCF PORTC ,4 ; !!Bank!! PORTC - TRISC - CM1CON0 - BAUDCTL BSF PORTC ,3 ; !!Bank!! PORTC - TRISC - CM1CON0 - BAUDCTL BCF PORTC ,7 ; !!Bank!! PORTC - TRISC
in
„Software Bügelstation“
·
Mikrocontroller und Digitale Elektronik
·
26.08.2016 12:12
CPI tmp, 0x31 ; Wenn "1" BREQ transmit_one ; Alle anderen: nichts tun RETI transmission_end: CBI PORTC , 1 ; CL = 0 CBI PORTC , 0 ; CE = 0 RETI transmit_zero: SBI PORTC , 0 ; CE = 1 CBI PORTC , 2 ; DATA = 0 CBI PORTC , 1 ; CL = 0 CALL WAIT_200us ; wait 200us SBI PORTC , 1 ; CL = 1 RETI transmit_one: SBI PORTC , 0 ; CE = 1 SBI PORTC , 2 ; DATA = 1 CBI PORTC , 1 ; CL = 0 CALL WAIT_200us ; wait 200us SBI PORTC , 1 ; CL = 1 RETI ; ************************************************************************** ; Warten, Zeit verbraten ; *
in
„RS232 zu SPI“
·
Mikrocontroller und Digitale Elektronik
·
25.08.2016 22:37
(TCNT0 == 124) //125 { TCNT0 = 0; timer0_counter++; if (timer0_counter == 624) //625 { seconds++; PORTC ^= (1<<PC5); // LED 1 toggle timer0_counter=0; if (seconds == 59) //60 seconds { seconds=0; minutes++; } lcd_clear(); strcpy(string, utoa(minutes, buffer, 10)); strcat(string, " "); strcat(string,
in
„ist meine software Uhr sauber programmiert?“
·
Mikrocontroller und Digitale Elektronik
·
24.08.2016 11:32
Thread
ich auch nur für analog Gedöns. AVcc versorgt u.a. den Port, an dem der ADC klemmt, hier also PORTC . Man braucht AVcc also nicht nur für Analog-Gedöns. Steht aber auch im Datenblatt ;)
Mikrocontroller und Digitale Elektronik
· Grübelnder
· 24.08.2016 11:52
· 8 Antworten
Zerocross = 0 Groupout Alias Portb.1 Config Portb.1 = Output Groupout = 0 'Config Servos = 1 , Servo1 = Portc .5 , Reload = 10 'Config Portc .5 = Output Config Adc = Single , Prescaler = Auto , Reference = Avcc Start Adc '---------------------------------------------------------------------------- ' Timer '-
in
„Leistungsreduzierung eines Kondensatormotors einer Poolpumpe (600W)“
·
Haus & Smart Home
·
20.08.2016 17:37
Thread
ATtiny1634_io-test.c * */ #include <avr/io.h> // outputs, low-active #define EN_DEBUG_LED PORTC &= ~(1<<PC1); #define DIS_DEBUG_LED PORTC |= (1<<PC1); // inputs, low-active #define INPUT1 !(PINB & 1<<PB3) // geht noch ned #define INPUT2 !(PINC & 1<<PC0) int main(void) {
PORTB = (1<<PB3); // enable pullup input1 DDRC = (1<<PC1); // set output debug-led PORTC = (1<<PC0); // enable pullup input2 while (1) { if(INPUT1 || INPUT2) { EN_DEBUG_LED;} else { DIS_DEBUG_LED;} } }
Mikrocontroller und Digitale Elektronik
· Markus
· 16.08.2016 08:01
· 24 Antworten
Thread
: > DDRC &= (1<<PC5); //Eingang und das bewirken? Huber M. schrieb im Beitrag #4748834: > PORTC = (1<<PC5); //Pullup Eingang > DDRD = (1<<PD0); //Ausgang LED Wozu gibt es & und | ? Was macht man, um EIN Bit auf 0 bzw. auf 1 zu setzen? Mal abgesehen davon, das Du Dir auch mal den
HUBER M */ #include <avr/io.h> #define tasterpins (1<<PC5) int main(void) { PORTC |= (1<<PC5); //Pullup Eingang DDRD |= (1<<PD0); //Ausgang LED void tastertest() { if (!(PINC &(1<<PC5))) { PORTD |= (1<<PD0); } else { PORTD &=
Softwareentwicklung
· Huber M.
· 10.10.2016 16:09
· 41 Antworten
" name-in-module="PORTB" offset="0x00" address-space="data"/> </instance> </module> <module name="PORTC "> <instance name="PORTC "> <register-group name="PORTC " name-in-module="PORTC " offset="0x00" address-space="data"/> </instance> </module> <module name="PORTD"> <instance name="PORTD"> <register-group
in
„Welche AVR besitzen die PIN Toggle Fähigkeit?“
·
Mikrocontroller und Digitale Elektronik
·
06.08.2016 20:57
PIN_B5 SBIT( PINB, 5 ) #define PIN_B6 SBIT( PINB, 6 ) #define PIN_B7 SBIT( PINB, 7 ) #endif #ifdef PORTC #define PORT_C0 SBIT( PORTC , 0 ) #define PORT_C1 SBIT( PORTC , 1 ) #define PORT_C2 SBIT( PORTC , 2 ) #define PORT_C3 SBIT( PORTC , 3 ) #define PORT_C4 SBIT( PORTC , 4 ) #define PORT_C5 SBIT( PORTC , 5 ) #define PORT_C6 SBIT( PORTC , 6 ) #define PORT_C7 SBIT( PORTC , 7 ) #define DDR_C0 SBIT( DDRC, 0 ) #define DDR_C1 SBIT( DDRC, 1 ) #define DDR_C2 SBIT( DDRC, 2 ) #define DDR_C3 SBIT( DDRC, 3 ) #define DDR_C4 SBIT( DDRC, 4 ) #define
in
„Bit im Register setzten ohne andere Bits zuverändern.“
·
Mikrocontroller und Digitale Elektronik
·
02.08.2016 13:52
Minuten breq weiter ret weiter: cp stunden_wek, Stunden breq buzer ret buzer: ldi temp4, 0b01000000 out PORTC , temp4 rcall warte clr temp4 in temp4, PINB sbrc temp4, Schnaulz rjmp buzer ende: ret ;**************************************** ; Timer Interupt ;**************************************** timer0_overflow
in
„Uhren Tuto mit Wecker“
·
Mikrocontroller und Digitale Elektronik
·
02.08.2016 10:56
Minuten breq weiter ret weiter: cp stunden_wek, Stunden breq buzer ret buzer: ldi temp4, 0b01000000 out PORTC , temp4 rcall warte clr temp4 in temp4, PINB sbrc temp4, Schnaulz rjmp buzer ende: ret ;**************************************** ; Timer Interupt ;**************************************** timer0_overflow
in
„Uhren Tuto mit Wecker“
·
Mikrocontroller und Digitale Elektronik
·
02.08.2016 06:25
Thread
#define COL_LATCH 7 #define ROW_LATCH 6 #define OE_PIN 5 // PORTB #define DATA_PORT PORTB // PORTC lower 4 bits are the keyboard return bits #define KEY_PORT PORTC #define KEY_PINS PINC #define KEY_DIR DDRC #define KEY_MASK 0x0F // matrix variables for in and output volatile uint8_t charbuff
Mikrocontroller und Digitale Elektronik
· Timo B.
· 03.08.2016 23:05
· 23 Antworten
Thread
PC5; //Als Ausgang setzen for(i = 0; i < 2; i++){ if( debounce( PIND, PD6 ) ) PORTC ^= 1<<PC5; //toggle/schreibe PC5 in PORTC was verbirgt sich hinter der debounce( PIND, PD6 ) function? und weiter sollte es nicht DDRD |= 1<<PD6 heißen ?
Mikrocontroller und Digitale Elektronik
· Martin Michael
· 02.08.2016 15:54
· 3 Antworten
define Max_Column 0x7f // 128-1 #define Max_Row 0x7f // 128-1 #define Brightness 0x0F #define xData PORTC #define RD_HIGH PORTA |= (1<<PA3) #define RD_LOW PORTA &= ~(1<<PA3) #define WR_HIGH PORTA |= (1<<PA4) #define WR_LOW PORTA &= ~(1<<PA4) #define RES_HIGH PORTA |= (1<<PA2) #define RES_LOW PORTA &= ~
in
„SSD 1351 - OLED ansteuern“
·
Mikrocontroller und Digitale Elektronik
·
30.07.2016 08:05
isr; void main(void) { UBYTE InPortA0 = 0x00; UBYTE InPortA1 = 0x00; UBYTE InPortA2 = 0x00; UBYTE InPortc = 0x00; UBYTE InPortA3 = 0x00; UBYTE InPortC5 = 0x00; UBYTE InPortC4 = 0x00; //Interner Oszillato mit 8MHz OSCCON = 0b01110010; CMCON = 0x07; //Komparator abschalten UCON = 0x00; UCFG = 0x00; //Alle
in
„PIC18F2550 digitaler Eingang RC4“
·
Mikrocontroller und Digitale Elektronik
·
29.07.2016 13:38
Thread
Datenblatt richtig verstanden ;) Könntest du mal den Codeausschnitt posten? Also die init von PORTC und die Stelle an der du einlesen möchtest? Gruß
//for ever { PORTA = 0x00; was soll das? PORTC = 0x00; LATA = 0x00; das hier ist genau das Gleiche! (warum willst du Inputs schreiben?) LATC = 0x00; [/c] Wie prüfst du den Code, Debugger? <edit> Ähhh.... hast du zwei verschiedene Codes
Mikrocontroller und Digitale Elektronik
· Harald Esslinger
· 31.07.2016 23:13
· 8 Antworten
<LED_TEST); //ON OFF if(!(PINB & (1<<ON_OFF))) { //Zurzeitige ON/OFF Funktion if(systemOn == 0) { PORTC |= (1<<LED_25); systemOn = 1; }else if(systemOn == 1) { PORTC &= ~(1<<LED_25); PORTC &= ~(1<<LED_50); PORTC &= ~(1<<LED_75); PORTC &= ~(1<<LED_100); systemOn = 0; } _delay_ms(500); } //FAN Speed if(!(PIND & (1<<FAN_SPD))) { switch (fan){ case 0: PORTC &= ~(1<<LED_100); PORTC |= (1<<LED_25); fan = 1; break; case 1: PORTC &= ~(1<<LED_25); PORTC |= (1<<LED_50); fan = 2; break; case 2: PORTC &= ~(1<<LED_50); PORTC |= (1<<LED_75); fan = 3; break; case
in
„Probleme mit dem Sleep Mode(ATMega328P)“
·
Mikrocontroller und Digitale Elektronik
·
28.07.2016 20:10
Thread
irsnd_send_data(&irmp_dat, TRUE); //ON Command senden _delay_ms(50); //Warten.. PORTC |= (1<<LED_25); //LED einschalten systemOn = 1; //System Aktivieren _delay_ms(500); }else if(systemOn == 1){ //Abfrage auf System ist bereits aktiv irmp_dat.protocol = IRMP_RC5_PROTOCOL
irsnd_send_data(&irmp_dat, TRUE); //ON Command senden um es auszuschalten _delay_ms(1000); //Warten PORTC &= ~(1<<LED_25); //Alle LEDS auschalten PORTC &= ~(1<<LED_50); PORTC &= ~(1<<LED_75); PORTC &= ~(1<<LED_100); systemOn = 0; //System dekativieren _delay_ms(
Mikrocontroller und Digitale Elektronik
· Felix Neumann
· 30.07.2016 21:24
· 18 Antworten
PC4 PC3 PD0 PC5 PC7 3 PD6 PD7 PA5 PA6 PA7 PD3 PD5 4 PC1 PA0 PA1 PA3 PA4 PC0 PA2 */ #define ResBC1 (PORTC |= (1<<PC2)) #define SetBC1 (PORTC &= ~(1<<PC2)) #define Resh2 (PORTC |= (1<<PC7)) #define Seth2 (PORTC &= ~(1<<PC7)) #define Resa2 (PORTD |= (1<<PD1)) #define Seta2 (PORTD &= ~(1<<PD1)) #define Resb2 (PORTD |= (1<<PD2)) #define Setb2 (PORTD &= ~(1<<PD2)) #define Resc2 (PORTC |= (1<<PC6)) #define Setc2 (PORTC &= ~(1<<PC6)) #define Resd2 (PORTC |= (1<<PC4)) #define Setd2 (PORTC &= ~(1<<PC4)) #define Rese2 (PORTC |= (1<<PC3)) #define Sete2 (PORTC &= ~(1<<PC3)) #define Resf2
in
„Eine "Kinderfrage" bzg. *.h und *.c“
·
Mikrocontroller und Digitale Elektronik
·
26.07.2016 13:21
Schnittstellen, Timer 0 und 2, ADC */ /* Ausgaenge */ PORTA = 0xff; DDRA = 0xff; PORTB = 0xff; DDRB = 0; PORTC = 0xff; DDRC = 0xff; PORTD = 0xff; DDRD = 0xff; /* Timer 1, Fast PWM OCR1B, OC1B */ TCCR1A = (1<<COM1B1) | (1<<WGM11); /* Fast PWM nicht inv. kan. B, Aufloesung nach ICR1 */ TCNT1 = 0; // ICR1 = PWM_init
in
„Eine "Kinderfrage" bzg. *.h und *.c“
·
Mikrocontroller und Digitale Elektronik
·
26.07.2016 13:20
<avr/io.h> #define SET_OFF 1 #define SET_ON 0 #define SEGMENT_REGISTER DDRC #define SEGMENT_PORT PORTC #define SEGMENT_ONE (1<<2) //PC2 #define SEGMENT_TWO (1<<1) //PC1 #define SEGMENT_THREE (1<<0) //PC0 #define SHIFT_REGISTER DDRB #define SHIFT_PORT PORTB #define DATA (1<<3) //MOSI (SI) #define LATCH
in
„Multiplexen ohne delay?“
·
Mikrocontroller und Digitale Elektronik
·
25.07.2016 23:45
<avr/io.h> #define SET_OFF 1 #define SET_ON 0 #define SEGMENT_REGISTER DDRC #define SEGMENT_PORT PORTC #define SEGMENT_ONE (1<<2) //PC2 #define SEGMENT_TWO (1<<1) //PC1 #define SEGMENT_THREE (1<<0) //PC0 #define SHIFT_REGISTER DDRB #define SHIFT_PORT PORTB #define DATA (1<<3) //MOSI (SI) #define LATCH
in
„Multiplexen ohne delay?“
·
Mikrocontroller und Digitale Elektronik
·
25.07.2016 22:52
Thread
Denkfehler? [code] DDRC = (1 << DDRC1) |(0 << DDRC2) | (0 << DDRC3) | (0 << DDRC4) | (0 << DDRC5); PORTC = (1 << PORTC 2)| (1 << PORTC 3)| (1 << PORTC 4)| (1 << PORTC 5); Ausgabe = (PINC5 << 0) | (PINC4 << 1) | (PINC3 << 2) | (PINC2 << 3); //Ich will hier Bit 0-3 entsprechend der PINC's setzen
gestalten als ich es in der Ausgaberoutine programmiert habe [code] //macros #define Heizung_an (PORTC |= (1 << PORTC 1)); // Funktion um das Relais zu schalten #define Heizung_aus (PORTC &= ~(1 << PORTC 1)); // Funktion um das Relais zu schalten [/code] Gruß Dietmar
Mikrocontroller und Digitale Elektronik
· Dietmar
· 22.07.2016 11:57
· 14 Antworten
Zahlen. #include <avr/common.h> // Registernamen, die allen AVR gemein sind. #define LCD_CONTROL PORTC #define LCD_CONTROL_DIR DDRC #define LightSwitch 2 #define LCD_RW_PIN 1 #define BiPolarMood 0 uint8_t LED_buff; uint8_t LED_count; void Check_IF_MrLCD_isBusy(void); void Peek_A_Boo(void); void LCD_Send_Command
in
„Atmega644 DCF77_Dekodierung“
·
Mikrocontroller und Digitale Elektronik
·
21.07.2016 10:19
&= ~((1 << ISC01) | (1 << ISC00)); // infinite main loop while (1) { // trigger leds for testing PORTC ^= (1 << PC1); _delay_ms(500); PORTC ^= (1 << PC1); // enable external interrupt GICR |= (1 << INT0); // set sleep mode set_sleep_mode(SLEEP_MODE_PWR_DOWN); // sleep_mode() has a possible race condition
in
„AVR-Tutorial als PDF“
·
Offtopic
·
19.07.2016 21:08
wird mit einem pnp-Transistor in der Versorgungsspannung jederAnzeige realisiert, die vom Mega8 am PortC angesteuert werden. Bei genauerer Betrachtung fällt auf, dass die vierAnzeigen nicht mehr ganz so hell leuchten wie die eine einzelneAnzeige ohne Multiplexen. Bei wenigenAnzeigen ist dies praktisch
in
„AVR-Tutorial als PDF“
·
Offtopic
·
19.07.2016 20:36
Thread
bleibt solange an dieser Stelle bis das OCF0-Flag gesetzt wurde. Ist dies der Fall, wird ein Pin an PORTC getoggelt, das Flag zurückgesetzt und das ganze wiederholt. Vermutlich wird in einem bestimmten Intervall eine LED ein-/ausgeschaltet.
solange an dieser Stelle bis das OCF0-Flag gesetzt > wurde. Ist dies der Fall, wird ein Pin an PORTC getoggelt, das Flag > zurückgesetzt und das ganze wiederholt. > Vermutlich wird in einem bestimmten Intervall eine LED > ein-/ausgeschaltet. genau so ist das
Mikrocontroller und Digitale Elektronik
· Florian S.
· 13.07.2016 10:41
· 8 Antworten
(1){ //TODO:: Please write your application code } } static void init_AVR ( void ) { // Debug Pin PORTC &= ~(1<<PC0); DDRC |= (1<<PC0); //Schütze PORTD &= ~( (1<<PD5) | (1<<PD6) | (1<<PD7) ); DDRD |= ( (1<<PD5) | (1<<PD6) | (1<<PD7) ); // Set CTC Mode @ 1kHz TIFR0 |= (1<<OCF0A); TIMSK0 |= (1<<OCIE0A)
in
„Compiler verhält sich seltsam“
·
Mikrocontroller und Digitale Elektronik
·
13.07.2016 07:50
Thread
Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Prescale = 1 Config Portc = Input Config Portb.1 = Output Config Portb.2 = Output Config Portb.3 = Output Config Portb.4 = Input Config Portb.5 = Input
Mikrocontroller und Digitale Elektronik
· ElektronikEckart
· 11.07.2016 23:27
· 12 Antworten
Thread
. (Aktueller Stand) [c] #include .... int main(void) { SPI_INIT(); while(1) { PORTC &= ~(1 << PC5); SPI_Transfer(0b00000101); PORTC |= 1 << PC5; } return(0); } [/c] Erkennt jemand einen Fehler in der SPI_INIT? die Transfer Funktion sollte so auf jeden fall in Ordnung
AVRe schrieb im Beitrag #4641315: > PORTC &= ~(1 << PC5); Als Ausgang gesetzt ? DDRC |= (1<<PC5); Normal ist doch PortB.4, also: DDRB |= (1<<PB4); und dann: PORTB &= ~(1 << PB4); Auch: [c] DDRB = (1 << DDB1) | (1 <
Mikrocontroller und Digitale Elektronik
· AVRe
· 09.07.2016 16:31
· 10 Antworten
Thread
dem avr habe ich zum schreiben der Daten folgendes: void write_RTC() { power_twi_enable(); PORTC |= (1<<PORTC 5) | (1<<PORTC 4); TWBR = 2; _delay_ms(5); TWCR = 0xA4; //start while (!(TWCR & (1<<TWINT))); TWDR = 0x08; //SLA + W TWCR = 0x84; while (!(TWCR & (1<<
0x94; //stop _delay_ms(5); } und zum lesen: void read_RTC() { power_twi_enable(); PORTC |= (1<<PORTC 5) | (1<<PORTC 4); TWBR = 2; _delay_ms(5); TWCR = 0xA4; //start while (!(TWCR & (1<<TWINT))); TWDR = (0x08 | 0x01); //SLA + R TWCR = 0x84;
Mikrocontroller und Digitale Elektronik
· Jing Peng
· 27.06.2016 20:08
· 12 Antworten
Thread
Konfiguration TWI/I²C '--------------------- $lib "i2c_twi.lbx" Config Twi = 100000 Config Sda = Portc .4 Config Scl = Portc .5 'LM75-Adressen Const Lm75_schreiben = &H90 Const Lm75_lesen = &H91 Dim Reghi As Byte Dim Reglo As Byte Dim Temp As Byte Dim Dezstr As String * 10 Declare Sub Getreg
Mikrocontroller und Digitale Elektronik
· Patrick D.
· 27.06.2016 13:05
· 8 Antworten
] with number (0-7) '----------------- 'Konfiguration TWI/I²C '--------------------- Config Sda = Portc .4 Config Scl = Portc .5 'LM75-Adressen Const Lm75_schreiben = &H90 Const Lm75_lesen = &H91 'DS1307-Adresse Const Ds1307_schreiben = &HD0 Const Ds1307_lesen = &HD1 I2cinit '--------------------- 'Konfiguration
in
„Bascom LM75 Schalttemperatur auslesen“
·
Mikrocontroller und Digitale Elektronik
·
27.06.2016 10:13
Thread
fragen, da mir das alles merkwürdig vorkommt. [code] /* -- Keypad -- */ #define row1_high PORTC |= (1 << DDC0) #define row1_low PORTC &= ~(1 << DDC0) #define row2_high PORTC |= (1 << DDC1) #define row2_low PORTC &= ~(1 << DDC1) #define row3_high PORTC |= (1 << DDC2) #define row3_low PORTC &= ~(1 << DDC2) #define row4_high PORTC |= (1 << DDC3) #define row4_low PORTC &= ~(1 << DDC3) #define column1_not_active !(PINC & (1<<PINC4)) #define column2_not_active !(PINC & (1<
Mikrocontroller und Digitale Elektronik
· Karl H.
· 25.06.2016 14:43
· 16 Antworten
Thread
("7 "); if ( PIND & (1<<PIND4) ) usart_transmit_string("* "); PORTC &= ~(1 << DDC0); // column 1 low PORTC |= (1 << DDC1); // column 2 high if ( PINC & (1<<PINC3) ) usart_transmit_string("2 "); if ( PINC & (1<<PINC4) ) usart_transmit_string("5 ");
// Pullup an PORTD |= (1 << DDD4); // Pullup an sei(); // Global Interrupts activate PORTC |= ((1 << DDC0) | (1 << DDC1) | (1 << DDC2) | (1 << DDC3)); // all rows high //PORTC &= ~(1 << DDC1); while (1){ PORTC &= ~(1 << DDC0); // row 1 low if ( !(PINC & (1<<PINC4)) ) usart_transmit_string
Mikrocontroller und Digitale Elektronik
· Franz
· 25.06.2016 10:30
· 14 Antworten
Thread
sts TCNT1L,temp1 ldi temp1,0b00111111 out PORTB,temp1 ;Bits setzen out PORTC ,temp1 sbi PORTD,4 sbi PORTD,5 ldi status,0 pop temp1 out sreg,temp1 pop temp1 reti ;******************************************************* Timer1_comp_B
Mikrocontroller und Digitale Elektronik
· haderlump
· 22.06.2016 09:45
· 10 Antworten