Subversion Repositories Projects

Rev

Rev 543 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 543 Rev 723
Line 33... Line 33...
33
 
33
 
34
 
34
 
35
int main(void)
35
int main(void)
36
{
36
{
-
 
37
        char i,Parity;                                                                                  // Bit-Counter and Parity Bit
37
        char i,Parity;                                                                                  // Bit-Counter and Parity Bit
38
        DDRA = 0b011;                                                                                   // PORT A INPUT: RESET; OUTPUT: Sync+Data
38
        DDRA = 0b011;                                                                                   // PORT A INPUT: /RESET; OUTPUT: Sync+Data
39
        DDRB = 0b00000000;                                                                              // PORT B INPUT: Jumper for Bypass
-
 
40
        DDRD = 0b0000000;                                                                               // PORT D INPUT: Switches + DX7-Sync
39
        DDRD = 0b0000000;                                                                               // PORT D INPUT: Switches + DX7-Sync
41
        PORTA = 0b111;                                                                                  // Pull-Up for /RESET, High for Sync+Data
Line 40... Line 42...
40
        PORTA = 0b111;                                                                                  // Pull-Up for /RESET; High for Sync+Data
42
        PORTB = 0b01000000;                                                                             // Pull-Up for Jumper
41
        PORTD = 0b0011111;                                                                              // Pull-Up for Switches
43
        PORTD = 0b0011111;                                                                              // Pull-Up for Switches
-
 
44
 
-
 
45
        while(1)                                                                                                // Main-Loop (Sending data all the time)
-
 
46
        {
-
 
47
                if (!(PINB & (1<<PINB6)))                                                       // By-Pass Mode
-
 
48
                {
-
 
49
                        if (PIND & (1<<PIND0)) PORTA |= 1 << PORTA1;    // A1=D0
-
 
50
                        else PORTA &= ~(1 << PORTA1);
-
 
51
 
-
 
52
                        if (PIND & (1<<PIND1)) PORTA |= 1 << PORTA0;    // A0=D1
-
 
53
                        else PORTA &= ~(1 << PORTA0);
42
 
54
                }
43
        while(1)                                                                                                // Main-Loop (Sending data all the time)
55
                else                                                                                            // Normal Mode
Line 44... Line 56...
44
        {
56
                {
45
                Parity = 0;                                                                                     // Reset Parity Bit
57
                        Parity = 0;                                                                             // Reset Parity Bit
Line 58... Line 70...
58
                        }
70
                                }
59
                }
71
                        }
Line 60... Line 72...
60
 
72
 
61
                Send(0,Parity);                                                                         // Send Parity Bit
73
                        Send(0,Parity);                                                                 // Send Parity Bit
-
 
74
                }
Line 62... Line 75...
62
        }
75
        }