-
Datei
LCD_4BIT_BF.asm
aufrufen -> fertig .NOLIST .include "4433def.inc" .LIST ; PINOUT AVR PC5 PC4 PC3 PC2 PC1 PC0 PB0 ; PORTC/B | | | | | | | ; PIN LCD RS RW D7/BF D6 D5 D4 EN .EQU LCD_Port = PORTC .EQU RS = 5 .EQU RW = 4 .EQU EN = 0 .EQU BF = 3 .EQU CS = 2 ;****************************************************************
in „LCD 4Bit modus und BF flag mit Menue Text ausgabe AVR Assem“ · Projekte & Code ·
-
Datei
Capture_Store_Send_07_2305.txt
Pointer Start_Adress=Storage_p; //Remember the Start Adress if (Storage_p==0) printf("Stpeicher!"); PORTC.0=0; // Set LED Port C 0 "READY" while (1) { //printf("M"); if (Init &! PIND.2) //Push Start Button { // printf("R"); PORTC.0=1; //Turn Off LED Start=1; //Setbit Start // delay_ms(1000); TCCR1B=0x01
in „ADXL beschleunigungsmesser auswerten“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
CAM.bas
11059200 Config Portb.0 = Output Cts Alias Portb.0 Config Portd.6 = Output Rts Alias Portd.6 Config Portc.0 = Output Led Alias Portc.0 Config Pinc.3 = Input Cmd_01 Alias Pinc.3 Config Pinc.2 = Input Cmd_02 Alias Pinc.2 Config Pinc.1 = Input Cmd_04 Alias Pinc.1 Config Pind.2 = Input Ausloeser Alias Pind
in „IQP500 Kamera vom S55 an AVR?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
komfortstart.c
: Zündung ein/ausschalten // ********************************* int zuendung(int n) { if(n == 0) { PORTC &= ~(1<<PC0); // Zündung ausschalten, Übergabewert aus = 0 } if(n == 1) { PORTC |= (1<<PC0); // Zündung einschalten, Übergabewert ein = 1 } return 0; } // ********************************* // FUNKTION
in „PD0 (RXD) und PD1 (TXD) am ATMega8 ganz normal als I/O PINs nutzbar?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
Summe durch vier teilen = arithm. Mittelwert return result; } void drive_Motor(u8 Dir, u8 Enable){ PORTC &=~((1<<IN1)|(1<<IN2)); // Fast motor stop PORTB &=~(1<<EN); // Stop Motor switch (Enable) { case ON: if(Dir){ PORTC &=~(1<<IN1); PORTC |=(1<<IN2); //transmit_str_USART("jump1 \n "); //for(;;){;} } else{ //transmit_str_USART("jump2 \n "); //for(;;){;} PORTC &=~(1<<IN2); PORTC |=(1<<IN1); } PORTB |=(1<<EN); break; case OFF: //transmit_str_USART("jump3 \n "); //for(;;){;} PORTC &=~((1<<IN1)|(1<<IN2)); break; default: break; } //transmit_str_USART("jump4
in „Program läuft nach reset nur manchmal wieder an“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd1.asm
00h): paadr equ 00h ; Address of PortA pbadr equ 01h ; Address of PortB pcadr equ 02h ; Address of PortC cwadr equ 03h ; Address of Control Word ;stuff to be written into the control word of the 8255: ;Some of the change the state of the ports and some manipulate ;bits on port C allpsin equ 9bh ; set
in „HD61830 an Z80 ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
programm.txt
" // Notwendig für Assembler Befehle #define LCD_D6 PORTA.4 #define LCD_D7 PORTA.5 #define LCD_D5 PORTC.2 #define LCD_RS PORTC.3 #define LCD_E PORTC.4 #define LCD_D4 PORTC.5 unsigned char x; // unsigned char z; // unsigned char z2; // unsigned char LCD_DATA; // void AUSGABE(void); void LCD_INIT(void)
in „LCD-Display ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
Wortuhr_Meilenstein.pdf
Ausgabe der Uhr ----------------------- if (m1<5) //Zusatz "UHR" zur vollen Stunde { PORTB = UHR1 [h1]; PORTC = STD2 [h1]; PORTD = MIN1 [m1]; PORTA = MIN2 [m1]; } else if (m1>=20) //Nach 20min eine Stunde weiter + "s" bei Eins { PORTB = HALB1 [h1]; PORTC = HALB2 [h1]; PORTD = MIN1 [m1]; PORTA = MIN2 [m1]; } else if ((m1>=5) && (h1==1)) //"s" kommt wieder { PORTB = ES [h1]; PORTC = HALB2 [h1]; PORTD = MIN1 [m1]; PORTA = MIN2 [m1]; } else { PORTB = STD1 [h1]; //Normaler Ablauf PORTC = STD2 [h1]; PORTD = MIN1 [m1]; PORTA = MIN2 [m1]; } } } /* Ausgabe der Uhr innerhalb einer Stunde
in „Programmcode überprüfen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PIC16F886.asm
; !!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 ·
-
Datei
Matthias_Wecker1.bas
19200 $hwstack = 32 $swstack = 10 $framesize = 40 Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portc.1 , Rs = Portc.0 Config Lcdbus = 4 Cursor Off Ddrb = &B11111111 Ddrd = &B00000000 Portd.0 = 1 Portd.1 = 1 Portd.2 = 1 Portd.3 = 1 Portd
in „Uhr Bascom problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
temperatur.c
unsigned int wert) { int i, code = 0; for (i=0; i<8; i++) { code = (wert & codes[i]); if (code) { PORTC = zahl[1]; } else { PORTC = zahl[0]; } _delay_ms(500); PORTC = 0x00; _delay_ms(100); } } int main (void) { DDRD = 0xFF; DDRC = 0xFF; PORTD = seg[2]; int ergebnis = wire_reset(); if (ergebnis == 1)
in „Kleines Timingproblem beim DS1820“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
temperatur.c
unsigned int wert) { int i, code = 0; for (i=0; i<8; i++) { code = (wert & codes[i]); if (code) { PORTC = zahl[1]; } else { PORTC = zahl[0]; } _delay_ms(500); PORTC = 0x00; _delay_ms(100); } } int main (void) { DDRD = 0xFF; DDRC = 0xFF; PORTD = seg[2]; int ergebnis = wire_reset(); if (ergebnis == 1)
in „Code gibt immer den gleichen Binärcode aus“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
temperatur.c
wird bei aktivem Code richtig ausgegeben for (i=0; i<8; i++) { code = (wert & codes[i]); if (code) { PORTC = zahl[1]; } else { PORTC = zahl[0]; } _delay_ms(500); PORTC = 0x00; _delay_ms(100); } } int main (void) { DDRD = 0xFF; DDRC = 0xFF; PORTD = seg[4]; int ergebnis = wire_reset(); if (ergebnis == 0)
in „Code gibt immer den gleichen Binärcode aus“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd.h
7 /* DB7: set DD RAM address */ #define LCD_BUSY 7 /* DB7: LCD is busy */ #define LCD_1_D4 SBIT( PORTC, PC4 ) #define LCD_1_D4_DDR SBIT( DDRC, PC4 ) #define LCD_1_D5 SBIT( PORTC, PC5 ) #define LCD_1_D5_DDR SBIT( DDRC, PC5 ) #define LCD_1_D6 SBIT( PORTC, PC6 ) #define LCD_1_D6_DDR SBIT( DDRC, PC6 ) #define LCD_1_D7 SBIT( PORTC, PC7 ) #define LCD_1_D7_DDR SBIT( DDRC, PC7 ) #define LCD_1_RS SBIT( PORTC, PC2 ) #define LCD_1_RS_DDR SBIT( DDRC, PC2 ) #define LCD_1_E0 SBIT( PORTC, PC3 ) #define LCD_1_E0_DDR SBIT( DDRC, PC3 ) #
in „Atmega128 und PORTF“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
3xADC_SEND.c
= adc_value[channel] * 5.0 / 1024.0; dtostrf(voltage, 4, 3, ADC_val); switch (channel) { case 0: PORTC ^= (1<<PC0); //Send to RS232 uart_write("A"); uart_write(ADC_val); //uart_write("Volt"); uart_write("\r\n"); break; case 1: PORTC ^= (1<<PC1); //Send to RS232 uart_write("B"); uart_write(ADC_val); //uart_write("Volt"); uart_write("\r\n"); break; case 2: PORTC ^= (1<<PC2); //Send to RS232 uart_write("C"); uart_write(ADC_val); //uart_write("Volt"); uart_write("\r\n"); break; } if (++channel > 3 ) { channel = 0; } } } //------------------------------------
in „ATmega16: ADC0 Wert schwankt obwohl konst. Spannung anliegt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
6_Funkfernbedienung.bas
Input Portb.6 = 1 ' Pullup aktivieren Config Pinb.7 = Input Portb.7 = 1 ' Pullup aktivieren Config Portc.5 = Output ' für Sender Config Portc.4 = Output Config Portc.3 = Output ' Aliase zur Vereinfachung setzen ' ====================================================================================== Sender_daten Alias Portc.5 Sender_strom1 Alias Portc.4 Sender_strom2 Alias Portc.3 ' Aliase für die Dip-Schalter Schalter_1 Alias Pind.0 Schalter_2 Alias Pind.1 Schalter_3 Alias Pind.2 Schalter_4 Alias Pind.3 Schalter_5 Alias
in „Sender für Funkfernsteuerung für Dorma-Torantriebe, z.B. Modell HS43“ · Projekte & Code ·
-
Datei
switchcase.c
) { PINA = Taster; //Tasterstatus in Taster speichern //Taster = !Taster; switch(Taster) {case 1: PORTC = 0b00000001; //Taster 1 gedrückt Led 1 an Port C an break; case 2: PORTC = 0b00000010; //Taster 2 gedrückt Led 2 an Port C an break; case 4: PORTC = 0b00000100; //Taster 3 gedrückt Led 3 an Port C an break; case 8: PORTC = 0b00001000; //Taster 4 gedrückt Led 4 an Port C an break; default: PORTC = 0b01010101; //Kein Taster gedrückt Led 1,3,5,7 an Port C an break; } } return 0; }
in „Switch Case funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test168.c
D - Eingabe // Ausgänge auf 0=GND oder 1=HIGH (interne Pull-Ups) // PORTA = // PORTB = // LEDs // PORTC = PORTD = 0b11111111; // "Bass" } // LED per Bass einschalten while(1) { // Wenn Bass an PORTD (PIND0) anliegt schalte LEDs if (PIND&(1<<PIN0)) { PORTC |= (1<<PC0); // ... |= > Bit setzen an PORTC1 = LEDs an } else { PORTC &=~ (0<<PC0); // ... &=~ > Bit löschen an PORTC1= LEDs aus } } // while return 0; // return } // main
in „Audiotisch (Daft Punk)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ledumschalter.c
TASTE_GEDRUECKT; if( tasteVorher != tasteJetzt ) { if( tasteJetzt == TASTE_GEDRUECKT ) { switch (PORTC) { case 0b00000000: PORTC = 0b00000001; break; case 0b00000001: PORTC = 0b00000010; break; case 0b00000010: PORTC = 0b00000100; break; case 0b00000100: PORTC = 0b00000000; break; } } tasteVorher =
in „LED umschalten mit Taster“ · 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 "m8def.inc" .def temp=r16 .def counter=r17 .equ loops=32 .org 0x000 rjmp start .org 0x009 rjmp timer start: ldi temp, low(RAMEND
-
Datei
prog2altera.h
PINS * //************************ /* Define nCONFIG-PIN */ #define nCONFIG 0 #define nCONFIGPORT PORTC #define nCONFIGDDR DDRC /* Define DCLK-PIN */ #define DCLK 1 #define DCLKPORT PORTC #define DCLKDDR DDRC /* Define CONFDONE-PIN */ #define CONFDONE 2 #define CONFDONEPORT PORTC #define CONFDONEDDR DDRC /* Define DATA0-PIN */ #define DATA0 3 #define DATA0PORT PORTC #define DATA0DDR DDRC /* Define nSTATUS-PIN */ #define nSTATUS 4 #define nSTATUSPORT PORTC #define nSTATUSDDR DDRC //************************ //* ALTERA public functions * //***********************
in „Altera IV mit ATmega328 programmieren“ · FPGA, VHDL & Co. ·
-
Datei
prog2altera.h
PINS * //************************ /* Define nCONFIG-PIN */ #define nCONFIG 0 #define nCONFIGPORT PORTC #define nCONFIGDDR DDRC /* Define DCLK-PIN */ #define DCLK 1 #define DCLKPORT PORTC #define DCLKDDR DDRC /* Define CONFDONE-PIN */ #define CONFDONE 2 #define CONFDONEPORT PORTC #define CONFDONEDDR DDRC /* Define DATA0-PIN */ #define DATA0 3 #define DATA0PORT PORTC #define DATA0DDR DDRC /* Define nSTATUS-PIN */ #define nSTATUS 4 #define nSTATUSPORT PORTC #define nSTATUSDDR DDRC //************************ //* ALTERA public functions * //***********************
in „prog2altera - Library“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
CD32test.asm
Ausgang ldi r16, 0x00 out DDRC, r16 ; Port C ist Eingang ldi r16, 0xFF ; Port C Pullup-Widerstände out PORTC, r16 ; aktivieren. ldi r16, 0b00101000 ; 0b00101000 in r16 laden out DDRC, r16 ; PC 3 und 5 sind Ausgang, Rest ist Eingang ldi r16, 0xFF out PORTB, r16 ; PORTB auf 0xFF setzen -> alle LEDs aus ldi r16, 0x00 out DDRD, r16 ; Port D ist Eingang loop: sbic PIND, 0 cbi PORTC, 3 ; PL (PC3) auf OFF setzen, sbis PIND, 0 ; wenn Button 1 (PD1) gedrückt sbi PORTC, 3 sbic PIND, 1 ; CLK (PC5) auf ON setzen, sbi PORTC, 5 ; wenn Button 0 (PD0) gedrückt sbis PIND, 1 cbi PORTC, 5
in „ATMega8 - Tutorial-Fragen & CD32-Pad :-)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
/* Das Programm soll an dem Eingang PA0 eine Frequenz einlesen und diese als binär Wert an PortC ausgeben Eingang: PortA Pin0 Ausgang: PortC */ #include <avr/io.h> #include <avr/interrupt.h> #include <avr/signal.h> #include <avr/iom32.h> #include <avr/delay.h> #define SYSCLK 3686400 #define Preclk 3600 #define LEDS_DDR DDRC #define LEDS_PORT PORTC //Eine Zählvariable und eine Endwertvariable werden initialisiert volatile unsigned int zaehler2 ; volatile unsigned int endwert=0; SIGNAL (SIG_OUTPUT_COMPARE0 ) { endwert=zaehler2; PORTC=~endwert;
in „Interruptvorrang“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
mega128.h
define DDRA 0x1A #define PINA 0x19 #define PORTB 0x18 #define DDRB 0x17 #define PINB 0x16 #define PORTC 0x15 #define DDRC 0x14 #define PINC 0x13 #define PORTD 0x12 #define DDRD 0x11 #define PIND 0x10 #define SPDR 0x0F #define SPSR 0x0E #define SPCR 0x0D #define UDR0 0x0C #define UCSR0A 0x0B #define UCSR0B
in „AVRGCC und neue Megas?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Addon-Test.bas
.1 Lcd_db6 Alias Portb.2 Lcd_db7 Alias Portb.3 Lcd_e Alias Portb.4 Lcd_rs Alias Portb.5 Led1 Alias Portc.2 Led2 Alias Portc.3 Led3 Alias Portc.4 Led4 Alias Portc.5 Led5 Alias Portd.3 Led6 Alias Portd.4 Led7 Alias Portd.5 Led8 Alias Portd.6 Taste1port Alias Portc.1 Taste1 Alias Pinc.1 Summer Alias Portd.7 Ir Alias Pind.2 Irport Alias Portd.2 Nf Alias Portc.0 #endif #if _chip = 18 'Mega16 Lcd_db4 Alias Portb.2 Lcd_db5 Alias Portb.3 Lcd_db6 Alias Portb.4 Lcd_db7 Alias Portb.5 Lcd_e Alias Portb.6 Lcd_rs Alias Portb.7 Led1 Alias Porta.2 Led2 Alias Porta.3
in „Pollin AddOnBoard.ist LCD defekt?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Selingst_dt_experimental_atmega_32.bas
it into yours! Config Porta.0 = Output 'rote led beim Taster links Config Porta.1 = Output Config Portc.3 = Input Config Portc.2 = Output Config Portc.1 = Output Config Porta.4 = Input Config Portd.2 = Output Portc.0 = 1 Portd.2 = 1 Grun Alias Porta.0 'gelbe led im rechten Taster Rot Alias Porta.1 Nachricht Alias Pinc.3 Lednachricht Alias Portc.2 Ledalarm Alias Portc.1 Alarm Alias Pina.4 Const Sms1 = "alarm !!! GSM Alarm V2.1" Enable Interrupts 'Anfangssequenz For N = 1 To 10 Rot = 1 Waitms 50 Rot = 0 Waitms 50 Grun = 1 Waitms 50 Grun = 0
in „Sret geht nicht an Atmega 32, jedoch bei Atmega8!“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD.bas
transition of the STcp-input 'STcp - Pin 12 - storage register clock input 'gemeinsam Ser_data Alias Portc.0 : Config Ser_data = Output Clock_sr_lcd Alias Portc.1 : Config Clock_sr_lcd = Output Clock_st_lcd Alias Portc.2 : Config Clock_st_lcd = Output Declare Sub Send_lcd_byte(byval _byte As Byte) 'LCD DEM20485 SBH-PW-N Lcd_rs Alias Portc.0 : Config Lcd_rs = Output '1=Daten / 0=Kommando Lcd_rw Alias Portc.1 : Config Lcd_rw = Output '1=Read / 0=Write Lcd_enable Alias Portc.2 : Config Lcd_enable = Output 'fallende Flanke übertragen der
in „LCD DEM20485 in gerade Zeile springen (c't-Bot)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
einfacher_Code-RFM12-empfanger.bas
Wait_rfm12 Config Nsel = Output Config Sdi = Output Config Sck = Output 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 Nsel = 1 Sck = 0 'D = Spi16(&H80d7) ' El , Ef , 11.5pf, 433 MHz band D = &H80E7 : Gosub Wert ' El
in „RFM12 Module“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
gLCD_test.bas
hwstack = 40 $swstack = 16 $framesize = 32 $baud = 9600 Osccal = &HB7 'Ausgänge deklarieren Rs Alias Portc.1 Resetchip Alias Portc.4 Rw Alias Portc.3 Cs Alias Portc.2 En Alias Portc.0 Config Portc = Output Config Portb = Output 'Variablen Deklarieren Dim Gchr As String * 1 'Variable zum Auswählen ob Grafikmodus
in „HD61830B LCD-Controller mit Bascom ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.asm
OutLcdControl BTFSS PORTD, 6 call OUT24 BTFSS PORTD, 5 call OUT23 BTFSS PORTD, 4 call OUT22 BTFSS PORTC, 7 call OUT21 BTFSS PORTC, 6 call OUT20 BTFSS PORTC, 5 call OUT19 BTFSS PORTC, 4 call OUT18 BTFSS PORTD, 3 call OUT17 BTFSS PORTD, 2 call OUT16 BTFSS PORTD, 1 call OUT15 BTFSS PORTD, 0 call OUT14 BTFSS PORTC, 3 call OUT13 BTFSS PORTC, 2 call OUT12 BTFSS PORTC, 1 call OUT11 BTFSS PORTC, 0 call OUT10 BTFSS PORTE, 2 call OUT9 BTFSS PORTE, 1 call OUT8 BTFSS PORTE, 0 call OUT7 BTFSS PORTA, 5 call OUT6 BTFSS
in „PIC - Problem“ · 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 abschalten
in „Flash Speicher sparen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd.c
DATABUS_OLED_OUT = gfxdata; PORTA |= (1 << DC_OLED); // Set DC low for Display-Cmd, high for Gfx-data PORTC &= ~(1 << RW_OLED); // Set RW low for write _delay_us(5); PORTC |= (1 << RD_EN_OLED); // Set EN high for enable _delay_us(1); PORTC &= ~(1 << RD_EN_OLED); // Set EN low for disable } void send_cmd(
in „Schrift für Grafikdisplay, Text ausgeben“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
8_Kanal_Laufzeitmesser.c
// Starttaster if (PINC &(1<<PINC4)) // Kanal 1 Starttaster { counter_1_start=timer_1; Kanal_1=0; PORTC|=(1<<PC0); // Status LED einschalten } if (PINC &(1<<PINC5)) // Kanal 2 Starttaster { counter_2_start=timer_2; Kanal_2=0; PORTC|=(1<<PC1); // Status LED einschalten } if (PIND &(1<<PIND2)) // Kanal 3 Starttaster { counter_3_start=timer_3; Kanal_3=0; PORTC|=(1<<PC2); // Status LED einschalten } if (PIND &(1<<PIND3)) // Kanal 4 Starttaster { counter_4_start=timer_4; Kanal_4=0; PORTC|=(1<<PC3); // Status LED einschalten } // KANAL 1 if (PIND &(1<<PIND4
in „Über einen µC Laufzeit messen und über RS232 ausgeben“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
tasten.asm
3 .equ gled7 = 2 .equ gled8 = 1 .equ gled9 = 0 .equ gled10 = 0 .equ Pgled1 = PORTE .equ Pgled2 = PORTC .equ Pgled3 = PORTC .equ Pgled4 = PORTC .equ Pgled5 = PORTC .equ Pgled6 = PORTC .equ Pgled7 = PORTC .equ Pgled8 = PORTC .equ Pgled9 = PORTC .equ Pgled10 = PORTB ;Taster .equ tast1 = 1 .equ tast2 =
in „AVRStudio Simulator“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
temp.txt
Ascii ldi temp,$FF ;Port C ist Ausgang out DDRC,temp ldi temp,$03 ;RD und WR high(negative Logik) out PORTC,temp loop: ldi temp,$FF ;PORTB Ausgang out DDRB,temp ldi temp,$00 ;Adresse anlegen out PORTB,temp sbi PORTC,ALE cbi PORTC,ALE ldi temp,$00 ;PORTB Eingang out DDRB,temp ;ausser RD und WR cbi PORTC,RD ;RD auf low in temp,PINB ;einlesen sbi PORTC,RD ;RD wieder auf high andi temp,0b00001111 ;Bits maskieren add temp,const ;BCD nach Ascii rcall serout ;Steuerzeichen ausgeben ldi temp,10 rcall serout ldi temp,13 rcall serout rjmp loop serout: sbis
in „RTC Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Schrittmotor.asm
Drehgeber A INT2 ;PORTB, 3 ;PWM1 ;PORTB, 4 ;PWM2 ;PORTB, 5 ;ISP ;PORTB, 6 ;PWM5,ISP ;PORTB, 7 ;ISP ;PORTC, 0 ;zum Treiber H-Bruecke 2 ;PORTC, 1 ;Impuls- Ausgabe - 1 pro Schrittweite für externe Treiber ;PORTC, 2 ;JTAG ;PORTC, 3 ;JTAG ;PORTC, 4 ;JTAG ;PORTC, 5 ;JTAG ;PORTC, 6 ;Ausgang Richtung ;PORTC, 7
in „Spielerei mit einem 2- und 5-Phasen-Schrittmotor“ · Projekte & Code ·
-
Datei
LCD4BIT_neu.asm
aufrufen -> fertig .NOLIST .include "4433def.inc" .LIST ; PINOUT AVR PC5 PC4 PC3 PC2 PC1 PC0 PB0 ; PORTC/B | | | | | | | ; PIN LCD RS RW D7/BF D6 D5 D4 EN .EQU LCD_Port = PORTC .EQU RS = 5 .EQU RW = 4 .EQU EN = 0 .EQU BF = 3 .EQU CS = 2 ;****************************************************************
in „LCD 4Bit modus und BF flag mit Menue Text ausgabe AVR Assem“ · Projekte & Code ·
-
Datei
ledheart.c
PB1 + j)); } else { DDRB &= ~(1 << (PB1 + j)); PORTB &= ~(1 << (PB1 + j)); } } else { if(onoff) { PORTC |= (1 << (PC0 + (j-5))); } else { PORTC &= ~(1<< (PC0 + (j-5))); } if(sense == onoff) { DDRC |= (1 << (PC0 + (j-5))); } else { DDRC &= ~(1 << (PC0 + (j-5))); PORTC &= ~(1 << (PC0 + (j-5))); } } } inline void ledarray_all_off() { // turn off all row drivers DDRC &= ~(1<<PC5); PORTC &= ~(1<<PC5); // turn off all column drivers DDRC &= ~( (1<<PC0) | (1<<PC1) | (1<<PC2) | (1<<PC3) | (1<<PC4) ); PORTC &= ~( (1<<PC0) | (1<<PC1) | (1<<PC2) | (1<<PC3) | (1<<PC4) ); DDRB &= ~( (1<<PB1
in „Nerdkits LED-Heart - Duty-Cycle wie in ASM lösen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
post.asm
of upper RAM-Adress out SPH, akku ldi akku,0xff out DDRC,akku ;PortC auf Ausgang ldi akku,0x00 out PORTC,akku ;PORTC mit EN auf 0 ziehen ldi r21,0b10000000 ;maske für den Ausgabepin ldi r18,0x00 ldi r19,0x00 rcall SPI_Master_init ;SPI Bus konfigurieren sbr r20,32 ;setze bit für SPI daten SPI_main_start
in „SPI bus läuft nur sporadisch“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Communication.c
include <avr/io.h> #include <util/delay.h> #include "SysClk/SysClk.h" int main(void) { init_CLKSYS(); PORTC.DIRSET = PIN7_bm; PORTC.DIRSET = PIN5_bm; PORTC.DIRCLR = PIN6_bm; SPIC.CTRL = SPI_PRESCALER_DIV16_gc | /* SPI prescaler.(32Mhz/16 = 2Mhz) */ (false ? SPI_CLK2X_bm : 0) | /* SPI Clock double. */ SPI_ENABLE_bm
in „W5100->SPI defekt?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
IC.txt
) | (1<<TOIE1); //Input-capture interrupt enable, Overflow interrupt enable DDRC |= (1<<DDRC0); //PORTC0 als output sei(); //Interrupts global enable while(1) { time = ovflw*2^16+stop-start; //time = stopwert - startwert + (anzahl overflows*2^16) if(time > 1500) { PORTC |= (1<<PORTC0); //Signalleuchte, falls zeit über 1.5 ms } else { PORTC &= ~(1<<PORTC0); } } } ISR(TIMER1_CAPT_vect) { if (TCCR1B & (1<<ICES1)) { start = ICR1; //IC-Register speichern TCCR1B &= ~(1<<ICES1); //Flanke auf negativ TIFR = (1<<ICF1); } else { stop = ICR1; /
in „ATmega8 PWM mit Input Capture generieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
main.c
led1on() { PORTB.OUTSET |= PIN0_bm; } void led1off() { PORTB.OUTCLR |= PIN0_bm; } void led2on() { PORTC.OUTSET |= PIN0_bm; } void led2off() { PORTC.OUTCLR |= PIN0_bm; } void led3on() { PORTC.OUTSET |= PIN1_bm; } ISR(TCB0_INT_vect) { milli_ticks++; TCB0.INTFLAGS |= 1; } void led3off() { PORTC.OUTCLR |
in „ATtiny1624, Timer B läuft zu schnell ab“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Prog.txt
Config Porta.4 = Output Config Porta.5 = Output Config Porta.6 = Output Config Porta.7 = Output Config Portc.7 = Output Config Portc.6 = Output Config Portd.6 = Output Z0 Alias Porta.0 Z1 Alias Porta.1 Z2 Alias Porta.2 Z3 Alias Porta.3 Z4 Alias Porta.4 Z5 Alias Porta.5 Z6 Alias Porta.6 Z7 Alias Porta.7 Z8 Alias Portc.7 Z9 Alias Portc.6 Gen Alias Portd.6 'Input's Config Pind.3 = Input Config Pind.4 = Input Config Pind.5 = Input Taster1 Alias Pind.3 Taster2 Alias Pind.4 Taster3 Alias Pind.5 'Dimmer Dim Gen As Bit
in „100x10 leddotmatrix“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spi_send.c
Clock auswählen } } void port_init(void){ /* Init SS pin as output with wired AND and pull-up. */ PORTC.DIRSET = SS | MOSI | XCK; PORTC.PIN4CTRL = PORT_OPC_WIREDANDPULL_gc; /* Set SS output to high. (No slave addressed). */ PORTC.OUTSET = PIN4_bm; } void ir_init(void){ /* Enable low and medium level
in „AVR Xmega USART DMA“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
MT8888.c
PORTB.1=0;//RS0 PORTB.0=1;//RD PORTB.3=1;//WR PORTB.2=1;//CS while (1) { if(PIND.7==0)//taster { PORTC = 0b00001011; PORTB.1=1; //RS0 PORTB.2=0; //CS PORTB.3=0; //WR #asm nop nop nop #endasm PORTB.3=1; //WR PORTB.2=1; //CS delay_ms(2); PORTC = 0b00001000; PORTB.2=0; //CS PORTB.3=0; //WR #asm nop nop
in „MT8888 DTMF Ton erzeugen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD.bas
transition of the STcp-input 'STcp - Pin 12 - storage register clock input 'gemeinsam Ser_data Alias Portc.0 : Config Ser_data = Output Clock_sr_lcd Alias Portc.1 : Config Clock_sr_lcd = Output Clock_st_lcd Alias Portc.2 : Config Clock_st_lcd = Output Declare Sub Send_lcd_byte(byval _byte As Byte) 'LCD DEM20485 SBH-PW-N Lcd_rs Alias Portc.0 : Config Lcd_rs = Output '1=Daten / 0=Kommando Lcd_rw Alias Portc.1 : Config Lcd_rw = Output '1=Read / 0=Write Lcd_enable Alias Portc.2 : Config Lcd_enable = Output 'fallende Flanke übertragen der
in „LCD DEM20485 in gerade Zeile springen (c't-Bot)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DS18B20_Multiplexer_go1.bas
m32def.dat" $crystal = 16000000 $swstack = 50 $hwstack = 50 $framesize = 50 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 Cls Cursor Off '===============================================================================
in „DS18B20 multiplexen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DS18B20_Multiplexer_go2.bas
m32def.dat" $crystal = 16000000 $swstack = 50 $hwstack = 50 $framesize = 50 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 Cls Cursor Off '===============================================================================
in „DS18B20 multiplexen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pwm2.asm
TIMSK, temp2 sei loop: tst counter breq neu cp counter,lum0 ;alle PWM-Werte überprüfen brbc 1,a0 sbi PORTC,0 a0: cp counter,lum1 brbc 1,a1 sbi PORTC,1 a1: cp counter,lum2 brbc 1,a2 sbi PORTC,2 a2: cp counter,lum3 brbc 1,a3 sbi PORTC,3 a3: dec counter rjmp loop neu: ;falls Overflow in counter ldi temp,0 out PORTC,temp dec counter rjmp loop Timer: ;Überprüfung der Tasten push temp2 in temp2, SREG push temp2 ldi temp2, timespeed out TCNT0, temp2 in temp2, PIND cpi temp2, 0b11111111 brlt c1 jmp notaste c1: ;Lum0
in „Verbesserungen für PWM-Code?“ · Mikrocontroller und Digitale Elektronik ·