📄 text2.lst
字号:
654 1 EX1=0; //打开INT0中断请求
655 1
656 1 TH0=0;
657 1 TL0=0;
658 1
659 1 while (!RemPin); //等待高电平
660 1 TR0=1;
661 1 while (RemPin) //等待低电平
662 1 if (TF0==1) goto end; //超时就退出;
663 1 TR0=0;
664 1 temp=TH0;
665 1 temp=(temp<<8)+TL0;
666 1
667 1 if (temp>18000 || temp<4000) //判断同步码的宽度
668 1 {
669 2
670 2 goto end;
671 2 }
672 1 //同步码检测成功
673 1
674 1 if (temp<18000 && temp>13000)
675 1
C51 COMPILER V8.05a TEXT2 10/12/2007 22:10:38 PAGE 12
676 1 {
677 2 x1=4;
678 2 x2=7;
679 2 for (i=0; i<3; i++) //解 3*8=24 位码
680 2 for (j=0; j<8; j++)
681 2 {
682 3 while (!RemPin); //等待高电平
683 3 TH0=0;
684 3 TL0=0;
685 3 TR0=1;
686 3 while (RemPin) //等待低电平
687 3 if (TF0==1) goto end; //超时就退出
688 3 TR0=0;
689 3 temp=TH0;
690 3 temp=((temp<<8)+TL0);
691 3 if (temp>1200 && temp<1800)
692 3 {
693 4 receive[i]=receive[i]<<1;
694 4 receive[i]=receive[i]+1; //保存 1
695 4 }
696 3 else if (temp>300 && temp<702)
697 3 {
698 4 receive[i]=receive[i]<<1; //保存0
699 4 }
700 3 else goto end;
701 3 }
702 2
703 2 }
704 1
705 1
706 1
707 1 if (temp<13000 && temp>8000)
708 1
709 1 {x1=3;
710 2 x2=3;
711 2 for (i=0; i<3; i++) //解 3*8=24 位码
712 2 for (j=0; j<8; j++)
713 2 {
714 3 while (!RemPin); //等待高电平
715 3 TH0=0;
716 3 TL0=0;
717 3 TR0=1;
718 3 while (RemPin) //等待低电平
719 3 if (TF0==1) goto end; //超时就退出
720 3 TR0=0;
721 3 temp=TH0;
722 3 temp=((temp<<8)+TL0);
723 3
724 3
725 3 // /*
726 3 if (temp>800 && temp<1200)
727 3 {
728 4 receive[i]=receive[i]<<1;
729 4 receive[i]=receive[i]+1; //保存 1
730 4 }
731 3 else if (temp>200 && temp<600)
732 3 {
733 4 receive[i]=receive[i]<<1; //保存0
734 4 }
735 3 else goto end;
736 3 }
737 2
C51 COMPILER V8.05a TEXT2 10/12/2007 22:10:38 PAGE 13
738 2 }
739 1
740 1
741 1 if (temp<8000 && temp>4000)
742 1
743 1 { x1=1;
744 2 x2=5;
745 2 for (i=0; i<3; i++) //解 3*8=24 位码
746 2 for (j=0; j<8; j++)
747 2 {
748 3 while (!RemPin); //等待高电平
749 3 TH0=0;
750 3 TL0=0;
751 3 TR0=1;
752 3 while (RemPin) //等待低电平
753 3 if (TF0==1) goto end; //超时就退出
754 3 TR0=0;
755 3 temp=TH0;
756 3 temp=((temp<<8)+TL0);
757 3
758 3
759 3 // /*
760 3 if (temp>300 && temp<900)
761 3 {
762 4 receive[i]=receive[i]<<1;
763 4 receive[i]=receive[i]+1; //保存 1
764 4 }
765 3 else if (temp>20&& temp<300)
766 3 {
767 4 receive[i]=receive[i]<<1; //保存0
768 4 }
769 3 else goto end;
770 3 }
771 2
772 2 }
773 1 clr_12864();
774 1 Cs1_12864=0; Cs2_12864=1;
775 1 show_cha_12864(0,0,ok[2]);
776 1 show_cha_12864(0,16,ok[3]);
777 1 show_let_12864(2,24,time_let[x1]);
778 1 show_let_12864(2,32,ok1[1]);
779 1 show_let_12864(2,40,time_let[x2]);
780 1 show_let_12864(2,48,ok1[0]);
781 1
782 1 Cs1_12864=1; Cs2_12864=0;
783 1
784 1
785 1 show_cha_12864(0,32,ok[0]);
786 1 show_cha_12864(0,48,ok[1]);
787 1 show_cha_12864(2,0,ok[4]);
788 1 show_cha_12864(2,16,ok[5]);
789 1 show_cha_12864(4,0,ok[6]);
790 1 show_cha_12864(4,16,ok[7]);
791 1 show_cha_12864(6,0,ok[8]);
792 1 show_cha_12864(6,16,ok[9]);
793 1
794 1
795 1 show_let_12864(2,32,time_let[4]);
796 1 show_let_12864(2,40,time_let[3]);
797 1 show_let_12864(2,48,time_let[3]);
798 1 show_let_12864(2,56,ok1[0]);
799 1
C51 COMPILER V8.05a TEXT2 10/12/2007 22:10:38 PAGE 14
800 1
801 1 for (i=4; i<6; i++)
802 1 {
803 2 date1 = (bit)(receive[0] & 0x80);
804 2 receive[0]<<= 1;
805 2 date2 = (bit)(receive[0] & 0x80);
806 2 receive[0]<<= 1;
807 2 if(date1==0&&date2==0)
808 2 date=0;
809 2 else if(date1==1&&date2==1)
810 2 date=1;
811 2 else if(date1==1&&date2==0)
812 2 date=10;
813 2 else goto RemExit;
814 2 show_let_12864(4,i*8,time_let[date]);
815 2 }
816 1 for (i=6; i<8; i++)
817 1
818 1 {
819 2 date1 = (bit)(receive[0] & 0x80);
820 2 receive[0]<<= 1;
821 2 date2 = (bit)(receive[0] & 0x80);
822 2 receive[0]<<= 1;
823 2 if(date1==0&&date2==0)
824 2 date=0;
825 2 else if(date1==1&&date2==1)
826 2 date=1;
827 2 else if(date1==1&&date2==0)
828 2 date=10;
829 2 else goto RemExit;
830 2 show_let_12864(4,i*8,time_let[date]);
831 2 }
832 1 Cs1_12864=0; Cs2_12864=1;
833 1 for (i=0; i<2; i++)
834 1
835 1 {
836 2 date1 = (bit)(receive[1] & 0x80);
837 2 receive[1]<<= 1;
838 2 date2 = (bit)(receive[1] & 0x80);
839 2 receive[1]<<= 1;
840 2 if(date1==0&&date2==0)
841 2 date=0;
842 2 else if(date1==1&&date2==1)
843 2 date=1;
844 2 else if(date1==1&&date2==0)
845 2 date=10;
846 2 else goto RemExit;
847 2 show_let_12864(4,i*8,time_let[date]);
848 2 }
849 1
850 1 for (i=2; i<4; i++)
851 1
852 1 {
853 2 date1 = (bit)(receive[1] & 0x80);
854 2 receive[1]<<= 1;
855 2 date2 = (bit)(receive[1] & 0x80);
856 2 receive[1]<<= 1;
857 2 if(date1==0&&date2==0)
858 2 date=0;
859 2 else if(date1==1&&date2==1)
860 2 date=1;
861 2 else if(date1==1&&date2==0)
C51 COMPILER V8.05a TEXT2 10/12/2007 22:10:38 PAGE 15
862 2 date=10;
863 2 else goto RemExit;
864 2 show_let_12864(4,i*8,time_let[date]);
865 2 }
866 1 Cs1_12864=1; Cs2_12864=0;
867 1 for (i=4; i<6; i++)
868 1
869 1 {
870 2 date1 = (bit)(receive[2] & 0x80);
871 2 receive[2]<<= 1;
872 2 date2 = (bit)(receive[2] & 0x80);
873 2 receive[2]<<= 1;
874 2 if(date1==0&&date2==0)
875 2 date=1;
876 2 else if(date1==1&&date2==1)
877 2 date=0;
878 2 else if(date1==1&&date2==0)
879 2 date=10;
880 2 else goto RemExit;
881 2 show_let_12864(6,i*8,time_let[date]);
882 2 }
883 1 for (i=6; i<8; i++)
884 1
885 1 {
886 2 date1 = (bit)(receive[2] & 0x80);
887 2 receive[2]<<= 1;
888 2 date2 = (bit)(receive[2] & 0x80);
889 2 receive[2]<<= 1;
890 2 if(date1==0&&date2==0)
891 2 date=1;
892 2 else if(date1==1&&date2==1)
893 2 date=0;
894 2 else if(date1==1&&date2==0)
895 2 date=10;
896 2 else goto RemExit;
897 2 show_let_12864(6,i*8,time_let[date]);
898 2 }
899 1
900 1 goto end;
901 1
902 1 RemExit:
903 1 {
904 2 Cs1_12864=1; Cs2_12864=0;
905 2 show_cha_12864(0,32,ok[0]);
906 2 show_cha_12864(0,48,ok[1]);
907 2 Cs1_12864=0; Cs2_12864=1;
908 2 show_cha_12864(0,0,ok[10]);
909 2 show_cha_12864(0,16,ok[11]);
910 2 PX1=0;
911 2 EX0=1;
912 2 EX1=1; //打开INT0中断请求
913 2
914 2 TF0=0;
915 2 return;
916 2 }
917 1
918 1 end:
919 1 {
920 2 PX1=0;
921 2 EX0=1;
922 2 EX1=1; //打开INT0中断请求
923 2
C51 COMPILER V8.05a TEXT2 10/12/2007 22:10:38 PAGE 16
924 2 TF0=0;
925 2 return;
926 2 }
927 1
928 1 }
929
930
931
932
933 void main(void)
934 {
935 1 unsigned char i;
936 1 unsigned char clk_time[3]={0x00,0x00,0x12}; //秒,分,时寄存器初始
937 1 unsigned char temp=0x80; // 地址80:秒写入寄存器
938 1 write_1302(0x8e,0x00); //WP=0 写操作
939 1 for(i=0;i<3;i++)
940 1 {
941 2 write_1302(temp,clk_time[i]);
942 2 temp+=2;
943 2 }
944 1 write_1302(0x8e,0x80); //WP=1 写保护
945 1
946 1 ini_12864(); //初始化12864
947 1 clr_12864();
948 1
949 1
950 1
951 1
952 1
953 1 EA=1;
954 1
955 1 IT0=1; //设定INT1的触发方式为脉冲负边沿触发
956 1 IT1=1; //设定INT0的触发方式为脉冲负边沿触发
957 1 EX0=1; //打开INT1中断请求
958 1 EX1=1; //打开INT0中断请求
959 1 TMOD=0x01;
960 1
961 1 while(1)
962 1 {
963 2
964 2
965 2 ;
966 2
967 2 }
968 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 3508 ----
CONSTANT SIZE = 675 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 6 24
IDATA SIZE = ---- ----
BIT SIZE = ---- 4
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -