Easy-Downloader V1.1 with SDCC

[09-08 11:37:34]   来源:http://www.88dzw.com  微机|单片机   阅读:8650

文章摘要: Bill Of Materials January 4,2004 10:44:35 Page1 Item Quantity Reference Part ______________________________________________ 1 2 C1,C2 30pF disceramic 2 2 C8,C3 10uF 16V electrolytic 3 1 C4 10u

Easy-Downloader V1.1 with SDCC,标签:电路设计,http://www.88dzw.com
 
Bill Of Materials        January 4,2004      10:44:35 Page1

Item Quantity Reference Part
______________________________________________
 

1 2 C1,C2 30pF disceramic
2 2 C8,C3 10uF 16V electrolytic
3 1 C4 10uF 10V electrolytic
4 5 C5,C6,C7,C12,C13 10uF electrolytic
5 1 C9 470uF 25V electrolytic
6 2 C10,C11 0.1uF multilayer
7 2 C14,C15 0.1uF multilayer
8 1 D1 POWER small red LED for power indicator
9 1 D2 1N4007 silicon rectifier diode
10 1 J1 DC jack 
11 1 Q1 11.0592MHz low profile crystal
12 1 Q2 2N2907 PNP small signal transistor
13 1 Q3 2N2222A NPN small signal transistor
14 5 R1,R3,R6,R10,R11 10K
15 1 R2 250
16 1 R4 1150
17 1 R5 2150
18 1 R7 4.7k
19 1 R8 1k
20 1 R9 2k
21 1 U1 AT89C2051 20-pin DIP Microcontroller with 2kB Flash
22 1 U2 74LS373 D-type FF
23 1 U3 20-pin ZIF (Zero-Insertion-Force) socket
24 1 U4 LM317/TO adjustable regulator
25 1 U5 MAX232A 16-pin DIP RS232 level converter
26 1 U6 LM7805/TO fix +5V voltage regulator
27 1 VB1 SUB-D 9 (male) for NULL CABLE    DB9 connector
 


 

Figure 5: Component list.
 

Software
 

sdcc has the header file that declares bit variables and we can use them in program directly. We can define the specified bits as below,
 
#define LM317 P3_5
#define LE P3_7
#define prog P3_2
#define rdy P3_3
#define xtal P3_4
#define p10 P1_0
#define p11 P1_1
#define p12 P1_2
#define p13 P1_3
#define p14 P1_4
 

In c program, we can use assignment statement to set or clear them directly. For instance, function that makes low to high transition at P3.2,
 
pulseProg()
{
 prog = 0;
 prog = 0;
 prog = 0;
 prog = 1;
}
The ASCII strings were defined with modifier, 'code', so the compiled code will place them in code memory space.

char code title[] = '\n\r Easy-Downloader V1.3 for ATMEL 89C2051/4051 (sdcc version)';
char code prompt[] = '\n\r >';
char code ok[] = '\n\r ok';
 

I have built function that print string to terminal, to make it compatible with the old version with Micro-C. Look at the source cod here,
 
putstr(char *s)
{
 char i=0;
 char c;
 while((c=*(s+(i++)))!= 0) putchar(c); // while byte is not terminator, keep sending

上一页  [1] [2] [3] [4]  下一页


Tag:微机|单片机电路设计家电维修 - 单元电路介绍 - 微机|单片机

《Easy-Downloader V1.1 with SDCC》相关文章