Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <hidef.h> /* common defines and macros */
- #include "derivative.h" /* derivative-specific definitions */
- unsigned int CHECK = 0;
- unsigned int DIRECT = 0;
- unsigned int b = 0;
- unsigned int DIR = 0;/*
- unsigned int bit_0 = 0;
- unsigned int bit_1 = 0;
- unsigned int bit_2 = 0;
- unsigned int bit_3 = 0;*/
- unsigned int bits4 = 0;
- void main()
- {
- DDRP = 0xF0;
- DDRB = 0xF0;
- PUCR |= 0x02;
- TSCR2 = 0x83;
- DIRECT=12536;
- TSCR1 = 0x80;
- PORTB = 0xFF;
- EnableInterrupts;
- for (;;)
- {}
- }
- interrupt 16 void TOF()
- {
- TFLG2 = 0x80;
- CHECK=PORTAB;
- /*bit_0 = (PORTAB & 1);
- bit_1 = (PORTAB & 2) >> 1;
- bit_2 = (PORTAB & 4) >> 2;
- bit_3 = (PORTAB & 8) >> 3;*/
- bits4 = PORTAB & 15;
- PORTB = bits4 << 4;
- /*if (bit_0){
- PORTB=0x7F;
- }*/
- // TODO: get byts [0,1,2,3];
- //if ((CHECK==12543)||(CHECK==12463)){
- // PORTB=0x00;
- //}
- // if ((CHECK==12542)||(CHECK==12462)){
- // PORTB=0x70;
- // }
- // if ((CHECK==12542)||(CHECK==12462)){
- // PORTB=0x70;
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement