U23 2007/Inhalt Abend 2/Schieberegister

From C4 Wiki
< U23 2007‎ | Inhalt Abend 2
Revision as of 21:50, 14 May 2007 by 134.99.96.58 (talk) (Unsere Ansteuerung)
Jump to: navigation, search

Datenblatt


Unsere Ansteuerung

A0 - CP
A1 - Data
A2 - Strobe
A3 - OE

Programm

Schieberegister - Ansteuerung schiebe 1 0 rein und Ausgabe aktiv.

#include <avr/io.h>
#define CP 0
#define DATA 1
#define STROBE 2
#define OE 3

int main(void)
{
       DDRA = 0xFF;
       PORTA = 0x00;
       PORTA |= (1<<STROBE)|(1<<OE);
       PORTA |= (1<<DATA);
       PORTA |= (1<<CP);
       PORTA &= ~(1<<CP);
       PORTA &= ~(1<<DATA);
       PORTA |= (1<<CP);
       PORTA &= ~(1<<CP);
       return 0;
}


Schieberegister - Ansteuerung setzte 1 rein und Ausgabe an!

int main(void)
{
       DDRA = 0xFF;
       PORTA = 0x0E;
       PORTA = 0x0F;
       PORTA = 0x0E;
         
       return 0;
}