📄 dianzhen.lst
字号:
C51 COMPILER V8.06 DIANZHEN 04/13/2007 07:12:11 PAGE 1
C51 COMPILER V8.06, COMPILATION OF MODULE DIANZHEN
OBJECT MODULE PLACED IN .\dianzhen.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE F:\avr\dianzhen\dianzhen.c BROWSE DEBUG OBJECTEXTEND PRINT(.\dianzhen.lst)
-OBJECT(.\dianzhen.obj)
line level source
1 #include<avr/io.h>
*** WARNING C318 IN LINE 1 OF F:\avr\dianzhen\dianzhen.c: can't open file 'avr/io.h'
2 #include<avr/delay.h>
*** WARNING C318 IN LINE 2 OF F:\avr\dianzhen\dianzhen.c: can't open file 'avr/delay.h'
3 #include<avr/sfr_defs.h>
*** WARNING C318 IN LINE 3 OF F:\avr\dianzhen\dianzhen.c: can't open file 'avr/sfr_defs.h'
4 #define uchar unsigned char
5 #define uint unsigned int
6 #define SER_RCK PB0
7 #define SER_DAT PB1
8 #define SER_SCK PB2
9 #define COL_DAT PC0
10 #define COL_RCK PC1
11 #define SER_PORT PORTB
12 #define COL_PORT PORTC
13 void DelayMs()
14 {
15 1 uint i,j;
16 1 for(i=0;i<35;i++)
17 1 for(j=0;j<35;j++);
18 1 }
19 void col_send_data(uchar value)
20 {
21 1 uchar i;
22 1 for(i=0;i<8;i++)
23 1 {
24 2 if(value&0x80)
25 2 PORTC|=_BV(COL_DAT);
*** ERROR C202 IN LINE 25 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTC': undefined identifier
26 2 else
27 2 PORTC&=~_BV(COL_DAT);
*** ERROR C202 IN LINE 27 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTC': undefined identifier
28 2 PORTC|=_BV(COL_RCK);
*** ERROR C202 IN LINE 28 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTC': undefined identifier
29 2 PORTC&=~_BV(COL_RCK);
*** ERROR C202 IN LINE 29 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTC': undefined identifier
30 2 value=value<<1;
31 2 }
32 1 }
33 void row_send_data(uchar value)
34 {
35 1 uint i;
36 1 PORTB&=~_BV(SER_SCK);/*关闭595输出端口*/
*** ERROR C202 IN LINE 36 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTB': undefined identifier
37 1 //将一个字节一位一位的发送到数据端口
38 1 for(i=0;i<8;i++)
39 1 {
40 2 DelayMs();
41 2 //如果发送字节的第一位为1,则置位数据发送端,否则发送0
42 2 if(value&0x80)
43 2 PORTB|=_BV(SER_DAT);
*** ERROR C202 IN LINE 43 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTB': undefined identifier
44 2 else
45 2 PORTB&=~_BV(SER_DAT);
C51 COMPILER V8.06 DIANZHEN 04/13/2007 07:12:11 PAGE 2
*** ERROR C202 IN LINE 45 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTB': undefined identifier
46 2 //时钟脉冲为上升延,则发送一位
47 2 PORTB|=_BV(SER_RCK);
*** ERROR C202 IN LINE 47 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTB': undefined identifier
48 2 PORTB&=~_BV(SER_RCK);
*** ERROR C202 IN LINE 48 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTB': undefined identifier
49 2 value=value<<1;
50 2 }
51 1 PORTB|=_BV(SER_SCK);/*一个字节发送完毕后,打开595输出端口,即向点阵发送一个字节*/
*** ERROR C202 IN LINE 51 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTB': undefined identifier
52 1
53 1 }
54
55 main(void)
56 {
57 1 uchar array[]={
58 1 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
59 1 0x00,0x24,0x24,0x3C,0x24,0x24,0x24,0x00,
60 1 0x00,0x3C,0x20,0x3C,0x20,0x20,0x3C,0x00,
61 1 0x00,0x20,0x20,0x20,0x20,0x20,0x3C,0x00,
62 1 0x00,0x20,0x20,0x20,0x20,0x20,0x3C,0x00,
63 1 0x00,0x38,0x44,0x44,0x44,0x4C,0x38,0x00,
64 1 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
65 1 };
66 1 uint i,j,k;
67 1 uchar *p1,*p2;
68 1 uchar temp;
69 1 DDRB=0xff;
*** ERROR C202 IN LINE 69 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'DDRB': undefined identifier
70 1 DDRC=0xff;
*** ERROR C202 IN LINE 70 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'DDRC': undefined identifier
71 1 PORTC=0xff;
*** ERROR C202 IN LINE 71 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTC': undefined identifier
72 1 PORTB=0xff;
*** ERROR C202 IN LINE 72 OF F:\AVR\DIANZHEN\DIANZHEN.C: 'PORTB': undefined identifier
73 1 while(1)
74 1 {
75 2 p1=array;/*复位*/
76 2 for(i=0;i<48;i++)
77 2 {
78 3 //一帧重复扫描200次
79 3 for(k=0;k<100;k++)
80 3 {
81 4 p2=p1;/*重新赋行的首地址*/
82 4 temp=0xfe;
83 4 //从第一行扫描到第八行即一帧
84 4 for(j=0;j<8;j++)
85 4 {
86 5 col_send_data(*p2);
87 5 row_send_data(temp);
88 5 p2++;
89 5 temp=temp<<1|0x01;
90 5 }
91 4 }
92 3 p1++;/*行的首地址向后推移一个*/
93 3 }
94 2 }
95 1 }
96
C51 COMPILATION COMPLETE. 3 WARNING(S), 14 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -