-
Thread
Free running mode ADC
Wertes von ADCresult gemäß vorgegebener Tabelle setzen if((ADCresult>=0) && (ADCresult<128)){ PORTC &= ~(1<<PC1); PORTC &= ~(1<<PC4); PORTC &= ~(1<<PC5); } else if((ADCresult>127) && (ADCresult<512)){ PORTC &= ~(1<<PC1); PORTC &= ~(1<<PC4); PORTC |= (1<<PC5); } else if((ADCresult>511) && (ADCresult<769)){ PORTC &= ~(1<<PC1); PORTC |= (1<<PC4); PORTC |= (1<<PC5); } else if((ADCresult>768) && (ADCresult<1024)){ PORTC |= (1<<PC1); PORTC |= (1<<PC4); PORTC |= (1<<PC5);
-
Thread
Nullstellenunterdrückung bei 7 Segment
' Ein-/Ausgänge Config Portb = Output '7 Sekment Config Portc.0 = Input Config Portc.1 = Input Config Portc.2 = Input Config Portc.3 = Input Config Portc.4 = Output Config Portc.5 = Output Ddrd = &B11111111 '1
'4 Portc.4 = 0 Case 5 Portb = &B00010010 '5 Portc.4 = 0 Case 6 Portb = &B00000010 '6 Portc
-
Thread
LED blinken lassen per Taster
[c] if(!(PINB & 0x01)) // Wenn Taste PortB.0 auf HIGH { PORTC ^= (1 << PC0); // LED an PB0 umschalten _delay_ms (200); } PORTC &= ~(1 << PC0); // LED an PB0 ausschalten (high-aktiv) //PORTC |= (1 << PC0); // LED an PB0 ausschalten
{ PORTC |= (1 << PC0); // LED an PC0 umschalten _delay_ms (200); PORTC &= ~(1 << PC0); // LED an PC0 umschalten _delay_ms (200); } PORTC = 0; [/c]
-
Thread
LCD an Atmega8 PortC
Hallo! Ich möchte gerne ein LCD an PortC des Mega 8 anschliessen. Ich hab jetzt eine Routine für einen Mega32 gefunden und möchte diese gerne verwenden. Jetzt hab ich nur ein Problem. Der Mega32 hat am PortC mehr anschlüsse. Und das
wählst kann da auch eingestellt werden. Definiere in der .h Datei halt: #define LCD_PORT PORTC Axel
-
Thread
LCD EA DOG-M und Bascom
'ATmega168 $crystal = 1000000 'Quarz: 1 MHz Config Portc = Output 'DOG 162, 4bit, 5 Volt 'Portc.0 = D4 'Portc.1 = D5 'Portc.2 = D6 'Portc.3 = D7 'Portc.4 = E 'Portc.5 = RS ' ---------------------- LCD DOG162 Init --------------------- Dog:
regfile = "m168def.dat" 'ATmega168 $crystal = 1000000 'Quarz: 1 MHz Config Portc = Output 'DOG 162, 4bit, 5 Volt 'Portc.0 = D4 'Portc.1 = D5 'Portc.2 = D6 'Portc.3 = D7 'Portc.4 = E 'Portc.5 = RS Dog: Restore Da For Wertx = 1 To 20 Read Balken Portc = Balken
-
Thread
2 atmega einen als porterweiterung
<<DDA0) | (1<<DDA1) | (1<<DDA2) | (1<<DDA3) | (1<<DDA4) | (1<<DDA5) | (1<<DDA6) | (1<<DDA7); PORTC |= (1<<DDC0) | (1<<DDC1) | (1<<DDC2) | (1<<DDC3) | (1<<DDC4) | (1<<DDC5) | (1<<DDC6) | (1<<DDC7); PORTC &= ~(1<<0); PORTC &= ~(1<<1); PORTC &= ~(1<<2); PORTC &= ~(1<<3); PORTC &= ~(1<<4); PORTC &= ~(1<<5); PORTC &= ~(1<<6); PORTC &= ~(1<<7); PORTD &= ~(1<<7); PORTB &= ~(1<<0); PORTB &= ~(1<<2); PORTB &= ~(1<<1); PORTA &= ~(1<<0); PORTA &= ~(1<<1); PORTA &= ~(1<<
-
Thread
Problem: 16 Bit Variable über UART zu empfangen
PORTD ^= (1<<PD2); _delay_us(100); PORTD ^= (1<<PD2); } void stop_conversion(void) { PORTC &= ~(1<<PC2); } void start_conversion(void) { PORTC |=(1<<PC2); } void reset_ADS1258(void) { PORTC &= ~(1<<PC0); _delay_us(100); PORTC |= (1<<PC0); _delay_ms(17); } void ADCInit
{ cli(); Command=0; buesy=1; t=0; while(t==0) { PORTC |=(1<<PC2); // START pin of ADS high level PORTC &=~(1<<PC2); // START pin low again PORTD &= ~(1<<PD2); //CS low for (int i=0; i<=4; i++) { SPI_Senden
-
Thread
Programmieren lernen?!
Portc.0 = 0 Portc.1 = 1 Waitms 20 Portc.0 = 1 Portc.1 = 0 Waitms 20....
es so probiert: Config Portc.0 = Output a Alias Portc.0 Config Portc.1 = Output X Alias Portc.1 was ich mit +1 machen soll verstehe ich nicht ganz :(
-
Thread
mit µC Sinus erzeugen + Amplitudenmodulation
(byte_1 & (0x01 << 5)) { // Pin auf High PORTC |= (1<<PC2); } else { // pin auf Low PORTC &=~ (1<<PC2); } // *************************** PortC1 ************ if
if (byte_1 & (0x01 << 7)) { // Pin auf High PORTC |= (1<<PC0); } else { // pin auf Low PORTC &=~ (1<<PC0); } }
-
Thread
LCD zu langsam
alles posten. Nur ein paar Ausschnitte: Hier werden die Signale eingelesen: [c] uint8_t newPORTC = PINC; if ( (newPORTC ^ lastPORTC) & 0x02 && (newPORTC & 0x02) ) { if (newPORTC & 0x01 ) xVAL--; else xVAL++; changed |= 0x01; } if ( (newPORTC ^ lastPORTC) & 0x08 && (newPORTC & 0x08) ) { if (newPORTC & 0x04 ) yVAL--; else yVAL++; changed |= 0x02; } if ( (newPORTC ^ lastPORTC) & 0x20 && (newPORTC & 0x20 ) ) { if (newPORTC & 0x10 ) zVAL--;
-
Thread
EADOGM162W-A-Anzeige mit XMEGA
(PC5) #define LCD_D7 PIN4_bm // Data Bit 7 (PC4) // Helper macros #define LCD_E_HIGH() (PORTC.OUTSET = LCD_E) #define LCD_E_LOW() (PORTC.OUTCLR = LCD_E) #define LCD_RS_HIGH() (PORTC.OUTSET = LCD_RS) #define LCD_RS_LOW() (PORTC.OUTCLR = LCD_RS) // Function Prototypes void lcd_init()
(nibble & 0x04) PORTC.OUT |= (1 << D6); // Set D6 if (nibble & 0x08) PORTC.OUT |= (1 << D7); // Set D7 } void LCD_EnablePulse(void) { PORTC.OUT |= (1 << E); // Set E HIGH _delay_us(1); // Pulse
-
Thread
LCD Dispaly initialisieren!
war kein copy paste, da der code auf nem anderen rechner läuft! Config Lcdpin = Pin , Db4 = PORTC.2 , Db5 = PORTC.3 , Db6 = PORTC.4, Db7 = PORTC.5 , Rs = PORTC.0 , E = PORTC.1
oder nimmst du das vom Nachbarn, weil es eh so ähnlich aussieht? > Config Lcdpin = Pin , Db4 = PORTC.2 , Db5 = PORTC.3 , Db6 = PORTC.4, Db7 > = PORTC.5 , Rs = PORTC.0 , E = PORTC.1 PORTC - AtMega16 -> JTAGEN Fuse abdrehen
-
Thread
Unklarheiten bei einem C Programm
Ich suche Erklärungen für diese Befehle. if(ACSR & (1<<ACO)){ PORTC |= (1<<DDC0); } else{ PORTC = (0<<DDC0); Ich habe das ganze gegoogelt aber nix gefunden. Kann da jemand kurz helfen?
Warum schreibt man denn PORTC = (0<<DDC0); anstelle PORTC = 0;
-
Thread
Atmega8 PORTD7 Problem
: cbi PORTD,7 ;PORTD,7 -> GND sbi DDRD,7 ;PORTD,7 als Ausgang GND cbi PORTC,5 ;PORTC,5 -> GND sbi DDRC,5 ;PORTC,5 als Ausgang GND @ Ben.B: Das Ganze befindet sich momentan noch auf dem Steckbrett. Danke für die Antworten
> cbi PORTD,7 ;PORTD,7 -> GND > sbi DDRD,7 ;PORTD,7 als Ausgang GND > cbi PORTC,5 ;PORTC,5 -> GND > sbi DDRC,5 ;PORTC,5 als Ausgang GND Kannst du mal erklären, was du damit genau veranstalten willst? Oliver
-
Thread
Codeschloss Timeout
; j++; PORTC |= (1<<PC5); _delay_ms(200); PORTC &= ~(1<<PC5); } if ( !(PIND & (1<<PIND1)) ) {t[j]=9; j++; PORTC |= (1<<PC5); _delay_ms(200); PORTC &= ~(1<<PC5); } if ( !(PIND & (1<<PIND0)) ) {t[j]=12; j++; PORTC
{ //Code falsch //3 lange Pieps über Summer PC5 PORTC |= (1<<PC5); _delay_ms(300); PORTC &= ~(1<<PC5); _delay_ms(300); PORTC |= (1<<PC5); _delay_ms(300); PORTC &= ~(1<<PC5); _delay_ms(300); PORTC |= (1<<PC5); _delay_ms(300); PORTC &= ~(1<<
-
Thread
LED ein/aus schalten mit Taster
DDRC=0xff; // als ausgang definieren while(1) { if (PINB&(1<<PB0)) PORTC=PORTC &~(1<<PC0); else PORTC=PORTC |(1<<PB0); } } } [/C]
while(1) { if (PINB&(1<<PB0)) PORTC=PORTC &~(1<<PC0); if(PINB&(1<<PB0)) PORTC = 0x00; } } könnte das funktionieren ???
-
Thread
Lochraster Projekt?
Portb.4 = 1 Waitms 10 Portb.4 = 0 Waitms 10 Portb.5 = 1 Waitms 10 Portb.5 = 0 Waitms 10 Portc.0 = 1 Waitms 10 Portc.0 = 0 Waitms 10 Portc.1 = 1 Waitms 10 Portc.1 = 0 Waitms 10 Portc.2 = 1 Waitms 10 Portc.2 = 0 Waitms 10 Portc.3 = 1 Waitms 10 Portc.3 = 0 Waitms 10 'Knight Rider Vorlauf 10 LED´s Portc.1 = 1 Waitms 10 Portc.1 = 0 Waitms 10 Portc.0 = 1 Waitms 10 Portc.0 = 0 Waitms 10 Portb.5 = 1 Waitms 10 Portb.5 = 0 Waitms 10 Portb.4 = 1 Waitms 10 Portb.4 = 0 Waitms 10 Portb
-
Thread
Takterzeugung in Assembler sinnvol?
an einer Stelle ändern und neu kompilieren. [C] void fast_clock(void) { while(1) { PORTC &= ~( 1 << PC1 ); PORTC |= ( 1 << PC1 ); } } [/C] würde genau dasselbe machen, aber die Hardwareinfo ist über mehrere Stellen verstreut. AVR-GCC-Tutorial
soll er das tun. Für den Rest ist [C] void Burst( unsigned int Ctr ) { while(Ctr) { PORTC |= ( 1 << PC1 ); Ctr--; PORTC &= ~( 1 << PC1 ); } } [/C] perfekt und spielt alle Stückchen die man braucht.
-
Thread
Anzeigetafel über lange Leitungen ansteuern
16 Decoder) for(verz=0;verz<laenge;verz++); for (i=0;i<4;i++) { PORTC &= ~(1<<PC4); for(verz=0;verz<laenge;verz++); PORTC |= (1<<PC5); for(verz=0;verz<laenge;verz++); PORTC &= ~(1<<PC5); for(verz=0;verz<laenge;verz
} for (i=4;i>0;i--) //In NO-OP Regi { PORTC &= ~(1<<PC4); for(verz=0;verz<laenge;verz++); PORTC |= (1<<PC5); for(verz=0;verz<laenge;verz++); PORTC &= ~(1<<PC5)
-
Thread
HD44780 (Pollin DV20208) Zeichenbreite stimmt nicht
define PIN_D7 PINC #define DDR_D7 DDRC #define BIT_D7 PC3 #define PORT_E PORTC #define DDR_E DDRB #define BIT_E PB2 #define PORT_RW PORTC #define DDR_RW DDRB #define BIT_RW PB3 #define PORT_RS PORTC #define DDR_RS DDRB #define BIT_RS PB1 #define PORT_RES PORTC #define DDR_RES DDRB #define BIT_RES PB1 //#define RESET_PIN_USED [/code] wenn ich alles datenbits am porta habe und den rest an portc?
-
Thread
DS18S20 wird vom ATmega8 nicht gefunden
swstack = 64 $framesize = 64 Config Lcd = 20 * 4a , Chipset = Ks077 Config Lcdpin = Pin , Db7 = Portc.0 , Db6 = Portc.1 , Db5 = Portc.2 , Db4 = Portc.3 , E = Portc.4 , Rs = Portc.5 Initlcd Config 1wire = Portd.7 Const Ds18s20 = &H10 Const Skiprom = &HCC
m8def.dat" $crystal = 8000000 Config Lcd = 20 * 4a , Chipset = Ks077 Config Lcdpin = Pin , Db7 = Portc.0 , Db6 = Portc.1 , Db5 = Portc.2 , Db4 = Portc.3 , E = Portc.4 , Rs = Portc.5 $hwstack = 40 $swstack = 40 $framesize = 60 Declare Sub Temperatur_aus_ds18b20 Declare Sub Temperatur_aus_ds18s20
-
Thread
Maximale Helligkeit von 7-Segment-Displays im PWM-Multiplex-Betrieb
status==1) PORTC |= (1<<PC4); if(status==0) PORTC &=~(1<<PC4); break; case 4: if(status==1) PORTC |= (1<<PC4); if(status==0) PORTC &=~(1<<PC4); break; case 5: if(
SELECT_SEGMENTS(unsigned char symbol) { switch(symbol) { // Unterstrich case '_': PORTC |= (1<<PC0); PORTC &=~(1<<PC1); PORTC &=~(1<<PC1); PORTC &=~(1<<PC1); PORTC &=~(1<<PC1); PORTC &=~(1<<PC1); PORTC &=~(1<<PC1); PORTC &=~(1<<PC1);
-
Thread
Probleme mit 74ACT573
Nikolaj > bsp... > PORTC.OUTSET = 0x00; // alle LE pin(74ACT573) auf L setzen > PORTE.OUTSET = 0xAA; // hiermit ich lade gewünschte Daten in Register > PORTC.OUTSET = 0x80; // ich lasse Latch daten übernehmen von > Register
hiermit ich lade gewünschte Daten in Register PORTC.OUT = 0x80; // ich lasse Latch daten übernehmen von Register.(aber nur für eine von 8) PORTC.OUT = 0x00; // und wieder Latch sperren
-
Thread
LEDs leuchten leicht bei 8x8 Register PWM
Portb.1 = 1 Waitus 50 Portb = 0 Portc = 0 Portc.0 = 0 Porta.0 = 1 Porta.0 = 0 Portb.2 = 1 Waitus 50 Portb = 0 Portc = 0 Portc.0 = 0 Porta.0 = 1 Porta.0 = 0
Portb.5 = 1 Waitus 50 Portc = 0 Portc.0 = 0 Porta.0 = 1 Porta.0 = 0 Portb.6 = 1 Waitus 50 Portb = 0 Portc = 0 Portc.0 = 0 Porta.0 = 1 Porta.0 = 0
-
Thread
ATmega 128 langsam?
In12 = Pinb.3 In13 = Pinb.4 In14 = Pinb.5 In15 = Pinb.6 In16 = Pinb.7 'Werte ausgeben Portc.0 = In1 Portc.1 = In2 Portc.2 = In3 Portc.3 = In4 Portc.4 = In5 Portc.5 = In6 Portc.6 = In7 Portc.7 = In8 Portd.0 = In9 Portd.1 = In10 Portd.2 = In11 Portd.3 = In12 Portd.4 = In13 Portd
In12 = Pinb.3 In13 = Pinb.4 In14 = Pinb.5 In15 = Pinb.6 In16 = Pinb.7 'Werte ausgeben Portc.0 = In1 Portc.1 = In2 Portc.2 = In3 Portc.3 = In4 Portc.4 = In5 Portc.5 = In6 Portc.6 = In7 Portc.7 = In8 Portd.0 = In9 Portd.1 = In10 Portd.2 = In11 Portd.3 = In12 Portd.4 = In13 Portd
-
Thread
AX81 - ZX81 im AVR
solltest Du weglassen, da die dazugehörigen Portpins als Eingang geschaltet sind. Alternativ kann man PORTC.5, PORTC.6 und PORTC.7 bei bestehenden ChipBasic Boards brücken. Die Fuses müssten beim Mega666, 644P und Mega1284P gleich sein, also: FUSE LOW = 0xe6 FUSE HIGH = 0xd1 FUSE EXT = 0xfc
m644 ATMega644 m644p ATMega644P m1284p ATMega1284P video_system ----------- t-l nur TV TV(PORTC.7) und LCD (PORTA) tvl VGA (PORTD.3), TV(PORTC.7) und LCD (PORTA) storage_system --------------- df Dataflash (AT45DB041D oder AT45DB081D) sd SD-Karte, RAW Sektoren ab Sektor 0 bootloader_pins
-
Thread
PORTC geht nicht auf High
> int main (void) { DDRC = 0xFF; while(1) { PORTC = 0xFF; } return 0; } [/c] Auch wenn ich es so schreibe, bekomme ich die LED's nicht zum leuchten.. [c]#include <avr/io.h> int main (void) { DDRC = 0xFF; while(1) { PORTC |= (1<<PINC5) | (1<<PINC4) | (1<<PINC3) | (1<<PINC2); } return 0; }[/c] Vielen Dank für schnelle Hilfe silch12
-
Thread
ATMEGA32 PORTC
Hallo, Bei ATMEGA32 warum kann ich beim PORTC verschiedene Ausgänge nicht ein und ausschalten? danke im voraus
-
Thread
ATMega 8, assembler | lcd und led funktionieren zusammen nicht
steckung für den lcd gerade gesteckt habe? oder ich habe den taster falsch gesteckt? einmal an den portc und in die erdung
oh, nein also muss ich jetzt noch ldi r16,0xff out portc, r16 schreiben?
-
Thread
welche Signale liefert ein Handy an TX
################## ' Programm '################################ If Pinc.0 = 0 Then Portc.5 = 1 Else Portc.5 = 0 If Pinc.1 = 0 Then Portc.5 = 1 Else Portc.5 = 0 If Pinc.2 = 0 Then Portc.5 = 1 Else Portc.5 = 0 If Pinc.3 = 0 Then Portc.5 = 1 Else Portc.5 = 0 Getline Sret Lcd "*" ;
If Pinb.1 = 0 Then 'Störungs LED ein Portc.4 = 1 Wait 1 Portc.4 = 0 End If If Pinc.0 = 0 Then Portc.5 = 1 Else Portc.5 = 0 If Pinc.1 = 0 Then Portc.5 = 1 Else Portc.5 = 0 If Pinc.2 = 0 Then Portc.5 = 1 Else Portc.5 = 0
-
Thread
Sharp GP2D02 Sensor auslesen mit CodeVisionAVR und einem AT90S8515
Aber ich hätte da noch ein paar Fragen: Wenn Laut Sensor VOUT das Bit 7 ist, dann ist das doch PORTC.7 oder? Das Gleiche dann für VIN: Bit 4 ist dann PORTC.4? Wie genau muss ich dann PORTC oder DDRC definieren? Eingänge sind 0 und Ausgänge sind 1, also würde das dann bedeuten 0b01111111 also 0x7F
macht es einfacher, dass später vielleicht mal auf einen anderen Port/Pin zu schieben. #define VIN PORTC.4 . VIN=0; . VIN=1; Entweder falsch gedacht oder nur der Kommentar falsch? >PORTC.4=0; //VIN auf high Das ist auf jeden Fall falsch: >wert=r_rotate(PORTC.7); //
-
Thread
LCD will nicht
= 0x06; //Cursor Autoinkrement warte(); PORTC |= (1 << 3); //RS auf 1 warte(); PORTB = 0xA3; //# auf LCD ausgeben warte(); PORTC |= (1 << 1); //enable ein warte(); PORTC &= ~(1 << 1); //enable aus warte(); while (1)
= 1 *RS = 0 So in sende ich wurde schreben: void sende (unsigned char b) { unsigned char portc = PORTB & 0xf8; PORTC = portc; PORTB = b; PORTC = portc | EN; // delay b = b + 1; b = b + 1; b = b + 1; PORTC = portc; } (Bist du sicher, daß die LCD und
-
Thread
Anfänger mit C LED ein
das mega-simple BSP abgetippt: [c] #include <avr/io.h> int main (void) { DDRC = 0xff; //PORTC |= (1 << 2); /* setzt Bit 2 an PortC auf 1 */ PORTC &= ~(1 << 2); /* loescht Bit 2 an PortC */ while(1) { } return 0; } [/c] Was an meinem ATmega32 passiert ist folgendes: In
1 << DDC3); DDRC &= ~( (1 << DDC5) | (1 << DDC6) | (1 << DDC7)); while (1) { PORTC |= (1 << 2); /* setzt Bit 2 an PortC auf 1 */ PORTC |= (1 << 3); /* setzt Bit 3 an PortC auf 1 */ _delay_ms(500); PORTC &= ~(1 << 2); /* loescht Bit 2 an PortC */
-
Thread
ATMega 64, ALL AVR, Anfänger Problem
DDRC 0x34. Moemntan scheitert es daran das ich die PortBITS nicht einzeln setzen kann [c] PORTC0 = V1_1; PORTC1 = V1_2; PORTC2 = V2_1; PORTC3 = V2_2; PORTC4 = V3_1; PORTC5 = V3_2; PORTC6 = Kranz_an; PORTC7 = Kranz_LR; PORTA0 = ML_Z; PORTA1 = MR_Z; [/C] Muss ich da statt
DDRC 0x34. > > Moemntan scheitert es daran das ich die PortBITS nicht einzeln setzen > kann > PORTC0 = V1_1; > PORTC1 = V1_2; > PORTC2 = V2_1; > PORTC3 = V2_2; > PORTC4 = V3_1; > PORTC5 = V3_2; > PORTC6 = Kranz_an; > PORTC7 = Kranz_LR; > > PORTA0 = ML_Z; > PORTA1 = MR_Z; >
-
Thread
Siebensegment Multiplexen in C
); // Zehnerstelle ausgeben PORTC = DIGIT_10; // Zehnerstelle einschalten _delay_ms(FREQ*4); // 2ms Warten PORTC = DIGIT_OFF; // SegmentAnzeige komplett ausschalten [/c]
ausgeben und den Zähler erhöhen, beim NÄCHSTEN Aufruf kommt dann das nächste Digit dran. Wenn Du PORTC 0xFF haben willst nimm statt PORTC |= 0xFF PORTC = oxFF, da sparst Du Dir das lesen des Ports, ausserdem reicht eine einfache Zuweisung PORTC = display[counter]; (Dir ist ja egal was vorher auf PORTCV
-
Thread
Denkfehler bei Matrixtastatur?
er auf .3,7V. Stimmen die Abfragen? Oder wo liegt der Fehler? Mein CODE: DDRC = 0x87; PORTC = 0x00; //DDRC = 0x07; while(1) { PORTC = 0x01; if (PORTC == 0x01) { if (PINC & (1<<PC3)) { PORTC = 0x80; } if ( PINC & (1<<PINC4)) { PORTC = 0x80; } if ( PINC & (1<<PINC5)) { PORTC = 0x80; } if ( PINC & (1<<PINC6)) { PORTC = 0x80; } } else { PORTC = 0x01 ;} PORTC = 0x01;
-
Thread
Die andere Firmware für AVR-NET IO
if(time1>=var_array[10]) { time1=0; PORTC &= ~(1 << PC0); PORTC |= (1 << PC1); } } } else { if(time1>=var_array[11]) { time1=0; PORTC &= ~(1 << PC1); PORTC
if(time1>=var_array[10]) { time1=0; PORTC &= ~(1 << PC0); PORTC |= (1 << PC1); } } } else { if(time1>=var_array[11]) { time1=0; PORTC &= ~(1 << PC1); PORTC
-
Thread
LCD zeigt nur Balken an, weis nicht mehr weiter;)
Mach es mal anders herum: Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.4 , Db6 = Portc.5 , Db7 = Portc.1 , E = Portc.2 , Rs = Portc.0 Config Lcd = 16 * 2 MfG Paul
.4 , Db5 = Portc.5 , Db6 = Portc.6 , > Db7 = Portc.7 , E = Portc.2 , Rs = Portc.0
-
Thread
Problem Bascom / LCD mit Atmega16
erklärst du nicht was du nun willst. Gib die config- zeile für LCDPIN an : Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.6 , Rs = Portc.4 MfG
mit LCD 16x2 nach anpassen auf meine Hardware mit $crystal = 4000000 Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2
-
Thread
Zwei kleine Fragen zu Bascom Do Loop Schleife
Config Lcdpin = Pin , Db7 = Portb.0 , Db6 = Portd.7 , Db5 = Portd.6 , _ Db4 = Portd.5 , E = Portc.4 , Rs = Portc.5 Config Lcd = 16 * 2 Cls Cursor Off On Int0 Beleuchtung Enable Int0 Config Int0 = Low Level Enable Interrupts '****************************************************
Config Lcdpin = Pin , Db7 = Portb.0 , Db6 = Portd.7 , Db5 = Portd.6 , _ Db4 = Portd.5 , E = Portc.4 , Rs = Portc.5 Config Lcd = 16 * 2 Cls Cursor Off Do 'LCD Ausgabe Loop Timer0_isr: Geschwindigkeit = Getadc(0) Shift Geschwindigkeit, Left, 4 'Mit 16 multiplizieren
-
Thread
Interrupt reagiert nicht richtig
Schieber AUF Config Pind.2 = Input 'Taster Schieber ZU Config Portc.1 = Output 'Relais Schieber AUF Config Portc.2 = Output 'Relais Schieber ZU On Int0 Stop_1 Config Int0 = Rising Enable
'Taster Schieber AUF Config Pind.2 = Input 'Taster Schieber ZU Config Portc.1 = Output 'Relais Schieber AUF Config Portc.2 = Output 'Relais Schieber ZU Config Portc.3 = Output 'LED On Int0 Stop_1 Config Int0 = Rising
-
Thread
Problem mit gosub in Bascom
B00000000 : Return H: Porta = &B10000000 : Return H0: Porta = &B00000000 : Return I: Portc = &B00000001 : Return I0: Portc = &B00000000 : Return J: Portc = &B00000010 : Return J0: Portc = &B00000000 : Return K: Portc = &B00000100 : Return K0: Portc = &B00000000 :
127 tragen und ihn PortC übermittel. Nur tut er das nicht, also ich kann zumindest an keinem Portpin von PortC einen positiven Pegel messen. Wo liegt das Problem?
-
Thread
Interupt on Change PIC
LED-Toggle-Routine so nicht (hab ich auch >Anfangs so machen wollen, geht aber nicht) > BTFSS PORTC,3 > BSF PORTC,3 > BTFSC PORTC,3 > BCF PORTC,3 Oops, is' mir gaanich aufgefallen... > movlw b'00001000' > xorwf PORTC,3 ;LED1 toggeln muss aber sein: movlw
@Sven Stefan nein, es gibt nur xorwf PORTC,0 ; -> Ergebnis in WREG xorwf PORTC,1 ; -> Ergebnis in PORTC daher: movlw b'00000001' xorwf PORTC,1 ; RC0 toggeln movlw b'00000010' xorwf PORTC,1
-
Thread
NOchmal ne Frage zur matrix-abfrage
pinb.5 = 1 then Portc.0 = 1 elseif pinb.6 = 1 then Portc.0 = 1 elseif pinb.7 = 1 then Portc.0 = 1 end if reset portb.1 set portb.2 if pinb.4=1 then Portc.0 = 1 elseif pinb.5 = 1 then Portc.0 = 1 elseif pinb.6 = 1 then Portc.0 = 1 elseif pinb.7 = 1 then Portc.0 = 1 end if reset portb.2 set portb.3 if pinb.4=1 then Portc.0 = 1 elseif pinb.5 = 1 then Portc.0 = 1 elseif pinb.6 = 1 then Portc.0 = 1 elseif
-
Thread
LCD Initialisierung
ser r16 out DDRA, r16 ;PortA als Ausgang out DDRC, r16 ;PortC als Ausgang CBI PORTC, 1 ;R/W=Low, Schreiben aktiv CBI PORTC, 2 ;RS=Low, Commandos werden gesendet OUT PORTA, temp1 Rcall lcd_enable nop Rcall lcd_delay50us pop r17 ;Register wieder
>lcd_enable: >... >sbi PORTC, 0 ;Enable-Bit setzen >... >cbi PORTC, 0 ;Enable-Bit rücksetzen was soll das?
-
Thread
AVR Timer 1 Normal/CTC Mode ?
"\n\t" "reti" "\n\t" ::[sreg] "I" (_SFR_IO_ADDR(SREG)), [port] "I" (_SFR_IO_ADDR(PORTC))); [/c]
"I" (_SFR_IO_ADDR(GPIOR1), [gp2] "I" (_SFR_IO_ADDR(GPIOR2), [port] "I" (_SFR_IO_ADDR(PORTC))); [/c]
-
Thread
Anfänger fragen zur Programmierung des Atmega32A in C
PORTC &= 255-_BV(0); Das müsste ja die kurzfassung von PORTC = PORTC & 255-_BV(1); sein oder? was wiederum Bitmanipulation sein müsste?! Doch was genau tut diese? und wie kommt es dazu das dadurch mit
für was steht? Frage 3: Ist PORTC &= 255-_BV(0); die kurzfassung von PORTC = PORTC & 255-_BV(1); Frage 3.1: Was macht diese Bitmanipulation? Und wie kommt es dazu das dadurch der pin auf 0 gesetzt wird? Frage 3.2: Ist PORTC
-
Thread
Hilfe und Tipps bei der Fehlersuche
$regfile = "M16def.DAT" $crystal = 16000000 Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , Rs = Portc.0 Rw Alias Portc.1 Config Rw = Output Rw = 0 Cls Do Locate 1 , 1 Lcd "Zeile 1" Locate 2 , 1 Lcd "Zeile
Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , *Rs* = Portc.0 Jo, *RS*, nicht RW an PC1 (!) anschließen! Bei deinem Listing steht: Rs = Portc.0 Im Schaltplan ist aber Portc
-
Thread
Probelme bei einem Programm
0b00001010 ;Vergleich mit Maske "S1 && !S2 && S3" breq led_ein ;Springe zu "LED einschalten" sbi portc, 0 ;LED an PORTC.0 aus rjmp loop led_ein: cbi portc, 0 ;LED an PORTC.0 ein rjmp loop
;Vergleich mit Maske "S1 && !S2 && S3" breq led_ein ;Springe zu "LED einschalten" sbi portc, 0 ;LED an PORTC.0 aus rjmp loop led_ein: cbi portc, 0 ;LED an PORTC.0 ein rjmp loop Ich verzweifel langsam noch.. sich das selber beizubringen ist nicht so einfach wie ich
-
Thread
Microcontroller über Windows Applikation anpassen. Aber wie?
Sequence[nextNr]; nextNr++; if( nextNr == lenSequence ) { nextNr = 0; PORTC &= ~(1<<PC1); PORTC &= ~(1<<PC2); PORTC &= ~(1<<PC3); PORTC &= ~(1<<PC4); } if( command & ROT ) { PORTC |= (1<<PC4); // Turn On Red LED } if( command
nextNr]; nextNr++; if( nextNr == lenSequence ) { nextNr = 0; } PORTC &= ~(1<<PC1); PORTC &= ~(1<<PC2); PORTC &= ~(1<<PC3); PORTC &= ~(1<<PC4); if( command & ROT ) { PORTC |= (1<<PC4); // Turn On Red LED } if(