REPORT
DEVICES-MODEM PROGRAMMING
COMMUNICATION BOARD
by
GOUGEON Stephane
Univeristy of Central Lancashire
Work Experience - 18/06/93 Preston
University of Central Lancashire
18/06/93 Preston
DEVICES-MODEM PROGRAMMING
COMMUNICATION BOARD
BY
GOUGEON Stephane
Contents
page
1. ABSTRACT
2. INTRODUCTION
3. UNIVERSITY of CENTRAL LANCACHIRE
1. Description
2. Living in Preston
3. Supporting Studies
4. Leisure Time at the University
4. THEORY
1. Overview
2. Compatibility
1. TTL logic levels
2. RS-232 interface standard
3. Devices Interface
4. Memory
5. Modem Interface
6. Clock
7. Controller
1. EPROM
2. Microcontroller
8. Main Theory Board Design
5. DESIGN
1. Theory
2. Circuit Board
6. METHOD & OPERATION
1. Board process
2. Algorithms & Programs
7. DISCUSSION
8. CONCLUSION
9. FRENCH SUMMARY
10. AKNOWLEDGMENTS
11. BIBLIOGRAPHY
1 . ABSTRACT
A weather station suitable for remote operation has been designed and constructed. The station is equiped with sensors to measure temperature, humidity , rainfall, pressure, wind direction and speed, and duration of sunshine
A personal computer local to the station monitors weather conditions at five-minute intervals, storing the data to disk after each set of measurements. The weather station control program, which runs continuously, is able to send its data files via the telephone (modem) to a remote computer when it is requested to do so .
The using of a personal computer to manage monitors, storage and modem is not suitable to a weather station locating away. A circuit board can be used instead of a computer. This circuit board has the same capabilities to manage monitors , storage and modem as a computer, but suit better to control a weather station.
The circuit board can also be usedfor a number of another different tasks .and uses .
2 . INTRODUCTION
The objective of the project was to design, develop a communication board between devices and a modem to achieve the following ends :
- To select a device from 8 others
- To read or to write the data of the device
- To store the data in a Ram
- To send the ram data to a modem or to store data modem in the ram
- To control the board by a micro-controller .
- To design the board
- To make the board method
3 UNIVERSITY of central LANCASHIRE
3.1 Description
The purpose of the University of Central Lancashire is to encourage and enable individuals to develop their full potential by providing a high quality and stimulating learning environment encompassing a wide range of relevant educational activities .
The University is located on a compact campus near the centre of the ancient town of Preston in the north-west of England.
It has 8,500 students studying full-time, 4,800 pat-time, mostly for degrees and diplomas and almost 1000 following programmes of study or conducting research for postgraduate qualifications
Full-time or Part-time Undergraduate Courses
The following is a list of all courses available at undergraduate level at the University:
- Lancashire Business School -
- Faculty of Cultural, Legal & Social Studies -
- Faculty of Design & Technology -
- Faculty of Health -
- Faculty of Science -
- Combined Honours Programmes -
3.2 Living in Preston
Preston is a busy market town comprising a mixture of Victorian arcades, paved shopping streets, modern precints and a covered market.Most of the big-name retailers are represented and there are many smaller traditional shops specialising in everything from clothes to music and books.
A Prime location
Situated in Preston, the administrative and commercial centre of the county, the University benefits from being part of a town centre with road and rail links to the rest of the country, whilst being close to the beautiful countryside of Lancashire, the Lake District and the Yorkshire Dales.
The town is a major focus of road and rail communications, with London and Glasgow being less than three hours by train
Accommodation and cost of living
There are approximately 1,650 places in halls of residence and university-owned flats, residences and houses .
All residences have kitchens with cookers, food lockers and refrigerators .
Living costs in Preston tend to be much lower than those in the south of england or in large provincial cities.Accomodation, food and travel costs will be the largest items in budget.
Costs for accomodation vary with the type :
Halls of residence on campus : £1,500 per annum including gas and electricity
University flats on campus : £1,500 per annum plus gas
Residence off campus : £1,300 per annum inclusice
University houses off campus : £1,200 excluding gas and electricity, single
£900 excluding gas and electricity, shared : Private sctor flats and houses form £25 to £35 per week excluding bills
Private sector lodgings : £45-£50 per week with bed, breakfast, evening meal, gas and electricity
Private sector lodgings sel-catering : £35-£40 per week, including gas and electricity.
3.3 Supporting Studies
The library and learning resources service
An up-to-date library and a learning resources service are developed which aims to be user-friendly .Information is not just available from books and journals (altough some 300,000 volumes and 1,700 periodical titles are stocked) but from diverse range of media including audio and visual tepes, slides, records, films and electronics sources
The library has over 700 reader places at study tables, drawning tables and carrels.
Photocopying is available and searches of information held on computer databases can be carried out.
Computing services
Whatever course you are studying, you may use the University's facilities.When arriving you can register to use the computing equipememt and will be able to collect a package of information and users-aids from the Computer Centre. Terminals can be found in open access rooms throughout the university. One room is open 24 hours a day for students .
Further instruction manuals, advice and assisteance can be gained rom then computer centre .
Computing services is responsible for providing the facilities, support and advice to all academic users of computing equipment across the university. Nearly a thousand networked PCs and work stations provide facilities for data management, programming, high resolution graphics and word-processing.The applications package available reflect those widely used in industry and commerce and are continually being updated and developed. An electronic mail system allows users to dend and receive messages from others users worldwide .
3.4 Leisure time at the university
Sport & recreation
The University's on-campus sports facilities comprise a sports hall, a general activities room amd a fitness and conditioning area. Squash courts and playing fields for uotdoors team games are situated a few miles away .
A wide programme of activities is provided :
Athletics, badmington, basketball, canoeing, cricket, dance, fencing, fitness-training, five-a-side football, golf, jockey, jogging, marital arts (judo, tae kwon do, aikido, kung fu ,,jui justui), mountaineering, netball, Rugby, sailing, skiing, soccer, squash, table-tennis, tennis, volley-ball, weight trainning and yoga.
Arts centre
The university arts centre was opened in 1976 and located in the former St Peter's Church, designated a building of special architectural interest.The centre provides a varied programm of theatre, music, dance, exhibitions and workshops for both staff and students and the local and regional community.
4.THEORY
4.1 OVERVIEW
The board must have the same main functions than a computer and so must be organized as a computer : address bus , command bus , data bus , input port , output port and a central unity .
Shoult have a picture but lost from word93.
So we can devide the board design in several parts :
- Devices Interface
- Memory
- Modem Interface
- Clock
- Controller
4.2 COMPATIBILITY
The purpose of our project is to create an interface between several devices and a modem :
- Each device uses a TTL logic for its data bites and command bites devices.
- Communication with a modem is possible with a a RS-232 serial interface
So to communicate with the devices and the modem, our circuit board must have a TTL logic and a RS-232 serial interface.
4.2.1 TTL logic levels
In the field of reason, arguments containing true and false statements are evaluated for validity. Because digital circuits are capable of only two discrete voltage levels they are called logic circuits .
The high and low levels of digital circuits can be equated with the concepts of true and false, logic 1, logic 0, yes or no, or on and off. some digital circuits equate a high voltage level to true and a low voltage level to false. Other digital circuits work in an opposite manner, equating a low voltage level to true and a high voltage level to false.
Transistor-to-Transistor Logic (TTL) is one of the oldest and most popular digital integrated circuit (IC) families. TTl circuits operate with a power supply of +5V .In an ideal situation +5V on the output of a TTL circuit is interpreted as a logic 0 level.
The actual specifications defining logic levels in TTL circuit must take into account the looading effects induced on the output of a TTL circuit by the other circuits that it is driving :
Any voltage between +5 V and 2 V is considered a logic 1.
A voltage between 0 V and 0.8 V is considered a logic 0
A voltage that falls between 0. V and 2 V is considered an
indeterminate level .
In this project we use TTL circuit and TTL logic to manage the circuit board. So we must have only TTL circuit or TTL compatible circuit .Indeed there are many types of circuit logic ,not compatible with TTL logic as MOS , CMOS .
4.2.2 RS-232 interface standard
The RS-232 standard (RS stans for Recommended Standard) was established by the EIA (Electronics Industries Association) in the 1960s to facilitate compatibility and interchangeability between computers and peripheral devices that were connected via serial ports.
RS-232 defines the electrical signal characteristics, mechanical interface, and the description of interchange circuits .
The modem
The next figure depicts the connections of a remote terminal and a computer via a standard telehone line .The terminal and computer are not directly connected; they are separated by devices called Modems cause digitals waveforms can not be transmitted over long lengths of wire.
µ §fig
Digital communications cannot be occur directly between a terminal and a computer employing standard telephone lines .Telephone lines were designed to carry signals in audible range of frequencies. The modems are devices that convert the two levels of a digital signal into two different tones. These audible tones can propagate along commercial phone lines with little degradation. The modem is a tranceiver, which means it transmits and also receives data. The process of impressing a digital signal into an analog carrier frequency is called modulation. The reverse process of recorvering a digital signal from an analog carrier is called demodulation. Thus the term modulator-demodulator is contracted to form Modem.
Terminal and communications equipment.
The word terminal indicates the end of the line, as in a bus terminal. In the phrase data terminal equipment (DTE),terminal indicates the two extreme ends of the data communications circuit. In the last figure the DTEs are the terminal and the computer. The modems are defined as data communications equipment (DCEs), because they exist to provide communications capability between two DTEs. (Although they are less frequently used, other terms attributed to the initials DCE are data circuit terminating equipment and data channel equipment.)
The terminal-modem and computer-modem connections conform to the RS-232 standard, whereas the connections between the two modems is as standard two-wire phone line. The DTE and DCE each have specific respomsabilities in the RS-232 communications scheme.
µ §
Most popular pins implemented in RS-232 connections
Pin Name Abbreviation
1 Frame ground FG
2 Transmit data TD
3 Receive data RD
4 Request to send RTS
5 Clear to send CTS
6 Data set ready DSR
7 Signal ground SG
8 Data carrier detect DCD
20 Data terminal ready DTR
GROUNDS
Frame ground : The FG is often left unconnected. When it is used, FG. is connected to the frame of the terminal or modem or earth ground. A proper FG guarantees that no dangerous voltages exist on the case of terminals or modems .
Signal ground : All signals in the RS-232 interface are reference to the SG
.This ground must be present and continuous for proper circuit operation.
DATA
Transmit data : Direction : DTE to DCE . Data travels from the DTE (terminal or computer) to the modem via pin 2, TD.
Receive data : Direction : : DCE to DTE . Data travels from the DCE (modem) to the DTE via pin 3, RD. It is important to note that the RS-232 transmit and receive data pins are defined from DTE's point of view. Thus the DCE receives data pin 2 (TD) and transmits data on pin 3 (RD) .
HANDSHAKING
Request to send : Direction DTE to DCE . RTS is taken to an active level to indicatethat the DTE is ready to transmit data. The DCE's usual respomse is to activate its carrier and prepare to translate the digital signals from DTE into the appropriate analog signals.
Clear to send : Direction DCE to DTE . So that the DTE knows that the modem has enabled its carrier and that data transmission can start, the DCE brings CTS to an active level. This is the central idea behind the concept of hanshaking : one device indicates status and the other device responds in turn .
Data terminal ready : Direction DTE to DCE . DTR is asserted by the DCE when it is powered up and ready. An active level on DTR indicates to the DCE that it is connected to a "live" DTE.
Data set ready : Direction DCE to DTE . DSR is the DCE's equivalent to DTR. When DSR is asserted, the DTE is informed that it is connected to a "live" DCE.
Data carrier detect : Direction DCE to DTE . DCD informs the DTE that a remote connections has been made.
What the process when a terminal and a modem are used to form a remote connection with a modem and a computer , as the last figure.
1. Each device is powered up and ready, and their respective device-alive signals are asserted (DTR for the terminal and DSR for the modem).
2. The terminal wants to send data, so it asserts RTS.
3. The modem activates the analog carrier and asserts CTS
4. The user or modem dials phone number of the remote modem and waits for an answer .
RS-232 voltage levels
The following table indicates RS-232 voltage levels and their standard interpretations .
Voltage Logic Control Teletype Terminology
+3 V to + 25 V 0 On Space
-3 V to -25 V 1 Off Mark
In contrast to TTL logic levels, where the more positive voltage is a logic 1 and the more negative voltage is a logic 0, RS-232 employs negative-logic levels;
the more voltage circuit is a logic 0, and the more negative voltage is a logic 1. A voltage that falls between +3V and -3V is an indeterninate level as is a TTL voltage that falls between 0.8V and 2.0V.
Most RS-232 devices operate with +12V and -12V power supplies. A typical mark is from -9V to -12V and a typical space is from +9V to +12V.Voltages out of this range usually indicate a circuit or interface malfunction .
4.3 DEVICES INTERFACE
The first part of our project is to be able to select one device to communicate with .
Components Research
We have to transmit 8 bits of data and 2 of command .The problem is there is not a transmitter of 2 bit .But we can transmit the bits of command of 4 devices at the same time .Then we have 4 * 2 bits of command = 8 bits .
So we can use 10 "octal bus transceivers" such as SN74LS245 : 8 for each devices + 2 for the bits of command .
We must select one of the 8 devices + 2 bytes of bits of command :
We can use a "BCD-to-decimal decoders/drivers" such as SN74LS145
Components Description
SN74LS245 : Octal bus transceivers with 3-state outputs
Bi-directional Bus Transceiver in a High-Density 20-pin package
3-State Outputs Drive Bus Lines Directly
PNP Inputs Reduce D-C Loading on Bus Lines
Hysteresis at Bus Inputs Improve Noise
Typical Propagation Delay Times ,Port-to-Port : 8 ns
Max Supply Voltage, Vcc : 7 V
Max Input Voltage : 7 V
Off-state Output voltage : 5.5 V
µ §
These octal bus transceivers are designed for asynchronous two-way communication between data buses .The Control function implementation minimizes external timing requirements.
The devices allow data transmission fron the A bus to the B bus or from the B bus to the A bus depending upon the logic level at the direction control (dir) input .The enable input (G/) can be used to disable the device so that the buses are effectively isolated . ( for further details ,see Annexe I.1 )
SN74LS145 : BCD-to-decimal decoders/drivers
Full Decoding of Input Logic
All Outputs are Off for Invalid BCD Input Conditions
Low power dissipation : 35 mW Typical
Max Supply Voltage, Vcc : 7 V
Max Input Voltage : 5.5 V
Max Current Output : 1 mA
µ §
These monolithic BCD-to-decimal decoder/drivers consist of eight inverters and ten four-input NAND gates .
Full decoding of valid BCD input logic ensures that all outputs remain off for all invalid binary input conditions ( for futher details ,see Annexe I.2 )
Theory Design
µ §
A : Octal Transceiver B : BCD-to-decimal decoder
"Dir" is the direction of the communication : Level 0 / Device to Board
Level 1 / Board to Device
"Data bus" is 8 bit-lines used to carry data .
The "Device select" allows the board to select one of the ten transceiver .
The board can't read or write (R/W) 10 bits in the same time , but it can (R/W) data byte of a device or command 2-bits of 4 device together .
Device Select/Address Data R/W
0 Command 2-bits of device 1,2,3,4 together
1 Data byte of device 1
2 Data byte of device 2
3 Data byte of device 3
4 Data byte of device 4
5 Command 2-bits of device 5,6,7,8 together
6 Data byte of device 5
7 Data byte of device 6
8 Data byte of device 7
9 Data byte of device 8
10 The devices are isolated
.... ..................................
.... ..................................
15 The devices are isolated
To R/W the command 2-bits or Data Byte of a device ,the board must select one of this address .
4.4 MEMORY
We have to be able to save data and to read it when we want : we need a Ram
Components Research
We can use the CY7C128 ram : 2048 * 8 static R/W Ram
But to implement this ram there are 11 bit of address : so we need a 11 bit binary counter to implement this ram . In addition we must be able to load an address into this counter or to reset it.
We can use 3 cascading synchronous 4-bit counters : SN74LS163A
Components Description
CY7C128 : 2048 * 8 Satic R/W RAM
Automatic power-down when deselected
CMOS for optimum speed/power
High Speed -25 ns
Low active power : 825 mW
Low standby power : 110 mW
SOIC package
TTL compatible inputs and outputs
Capable of withstanding greater than 2000V electrostatic discharge.
Max Supply Voltage : + 7 V
Max outputs Voltage : + 7 V
Max inputs Voltage : + 7 V
µ §
The CY7C128 is a high performance CMOS static RAM organized as 2048 words by 8 bits. Easy memory expansion is provided by an active Low chip enable (CE/), and active Low output enable (OE/) and three-state drivers. The CY7C128 has an automatic power-down feature, reducing the power consumption by 83% when deselected .
An active Low write enable signal (WE/) controls the writting/reading operation of the memory. When the chip enable (CE/) and write enable (WE/) inputs are both Low, data on the eight data input/output pins (I/O0 throught I/O7) is written into the memory location addressed by the adress present on the adress pins ( A0 throught A10).Reading the device is accomplished by selecting the device and enabling the outputs, CE/ and OE/ active low, while (WE/) remains inactive or High.
Under these conditions, the contents of the location adressed by the information on adress pins is present on the eight data input/ouput pins .
(For further details ,see Annexe I.3)
SN74LS163 : Synchronous 4-bit counters
Internal Look-Ahead for fast Counting
Carry ouput for N-bit Cascading
Synchronous Counting
Synchronously programmable
Load Control Line
Diode-Clamped Inputs
Max clock : 32 MHz
These synchronous, presettable counters feature an internal carry lokk-ahead for application in high-speed counting designs. Synchronous operation is provided by having all flip-flops clocked simultaneously so that the outputs change coincident with each other when so instructed by count-enable inpits and internal gating .These counters are fully programmable. This mode of operation eliminates the output counting spikes that are normally associated with asynchronous (ripple clock) counters, however counting spikes may occur on the (RCO) ripple carry output.
( for further details ,see annexe I.4) .
µ §
But we need 3 cascading 4-bit counters :
µ §
Theory design
µ §
C1, C2, C3 : 4-bit counter R : Ram
Data Bus : D0...D7
The line "End" is an output line ; When the ram scan is finished this line has a level 1 else it has a level 0 .
The line "Reset" is an input line used to reset the counters implementing the Ram i.e. we return the address Ram to zero .
The line "Load" is an input line which allows information to be loaded through the Data Bus into the counters .
In fact "0H" is loaded to C1 ; D0...D3 is loaded to C2 and D4...D7 is loaded to C3 .
So we can scan the Ram by steps of 16 Bytes .
We can go to the address : 000H to XX0H ( X is a hexadecimal variable ) to 7E0H , the last adress of the RAM.
4.5 MODEM INTERFACE
Now we must define the way to communicate with a modem .
Components research
We can use a communication interface IC : 8251A
Component Description
8251A : Programmable Communication Interface
Synchronous and Asynchronous Operation
Synchronous 5-8 bit Characters ; Internal or External Character
Synchronization ; Automatic Sync Insertion
Asynchronous 5-8 bit characters ; Clock Rate - 1, 16 or 64 times baud
Rate ; Break Characters Generation ; 1 , 1½ or 2 Stop Bits ; False Start
Bit detection ; Automatic Break Detect and Handling
Synchronous Baud Rate - DC to 64K baud
28-pin DIP package
All Inputs and Outputs are TTL compatible
Single +5V supply
Single TTL CLock
µ §
The Intel 8251A is the enhanced version of the industry standard Intel 8251 Universal Synchronous/Asynchronous Receiver/Transnitter (USART), designed for data communication .
The Intel 8251A is a too complex IC to be develop in this report ,but we can see its basic functional description in Annex II.1
The board uses a Synchronous Mode of Communication cause it's faster than an Asynchronous Mode .
Theory Design
µ §
4.6 CLOCK
To synchronise each IC of the board, we need a main clock .
Components Research
This clock generator must have a TTL compatible clock output and must be capable of generating high frequence : the 555 Timer
Component description
ICM7555IPA : Low Power 555 Timer
MAX power supply : 18V
TTL compatible Output
8-pin DIL plastic package
Monolithic integrated circuit timer which can be used to provide the basis for one-shot or astable timing operations. Typical accuracies are ± 0.5% 100 mS, ± 2% 3 mins and are dependent on the external components used.
Output will drive 2 standard TTL loads and interfaces directly with C-MOS.
µ §µ §
Theory Design
A useful astable oscillator is shown in next figure .Timing resistor RT is fed from output pin 3 instead of Vcc. CT is disconnected from the discharge transistor on pin 7 and connected to pin 2 trigger input instead. As before, CT charges to 2Vcc/3, at which point the flip-flop resets, switching the output to 0V. Now, instead of CT being suddenly discharged by T1, its discharge takes place via RT until reaches Vcc/3, When the trigger input sets the flip-flop again. The result is a symmetrical 50% duty cycle square wave with a frequency :
1
§ ƒ = µ §
1.4 CT RT
µ §
4.7 CONTROLLER
To control the different ICs of the board and to synchronize its operation we use a Micro-Controller. But there are too many pins to control, so we may use a EPROM that selects ICs pins the board need .
The EPROM must control 12 pins => Eprom Data : 16 bites
4.7.1 EPROM
Component research
An Eprom of Data-16-bites : M27C1024-15XF1
Component Description
M27C1024-15XF1 : EPROM CMOS Lower Power Types
Size : 1048576 bits
Organisation : 65536 words * 8 bits
Acess Time : 150 ns Max
Supply : + 5 V d.c. ± 5% Vcc supply current : 50 mA Max
Program voltage : 12.5 V
Package : 40 pin DIL ceramic
µ §
Theory Design
The EPROM manages "write" , "read" , "chip select" , "reset" and "communication direction" of the board IC's
µ §
The Eprom is programming in a way we just have to select an Eprom address to select one or several board ICs to communicate with.
EPROM PROGRAMMATION
The Eprom memorie must be configure to select or deselect :
RAM : "Chip Select" , "Read" and "Write"
8251A : "Chip Select" , "Read" , "Write"
"Command or Data" and "Reset"
Counters : "Clear" and "Load"
PIC : "Master Clear"
Interface : "Direction"
The next arrays shows the way to program the EPROM and the different functions that the EPROM allows the board to do .
4.7.2 MICROCONTROLLER
The microcontroller "PIC 16C55"
Component Description
PIC 16C55 : EPROM-Based 8-Bit CMOS Microcontroller
Low Power , high speed CMOS EPROM technology
Fully static chip design
Operating Frequency Range : DC - 8 MHz
Operating Voltage Range : 4.0 V to 5.5 V
Low Power Consumption
512 words of 12-bit progran EPROM
32 words of 8-bit data RAM
Only 33 single 12-bit-word instruction to learn
8 bit ALU
20 Bidirectional tristate I/Os
µ §
The PIC 16C55 is too complex to be descibed here , but all documents about are in the Annex II.2
Theory Design
In fact the PIC controls the EPROM that manages "write" , "read" , "chip select" , "reset" and "communication direction" of the board .
µ §
The Pic still has 4 pins not configured :
the first manages the clock of the counters (output pin).
the second and the third controls two TTL diodes (output pin).
one green : Board OK & one red : Board ERROR
The last is connected to the "End" line of the Ram . (Input pin )
So now we know the Pic Pin Configuration
PIC Pin Configuration
µ §
4.9 MAIN THEORY BOARD DESIGN
µ §
5.DESIGN
5.1 THEORY
The devices have a particular pin configuration that we must respect into the board to be able to communicate with .
Device Pin Configuration :
µ §
We can connect each device by a 20-way IDT Ribbon Cable and the appropriate
socket ( a straight mounting male header ) .
Decoupling
In medium and high frequency we must decouple the Vcc of the ground :
_ In medium frequency (100 to 100 KHz) by a 10 µF capacitor
_ In high frequency ( > 100 KHz) by a 0.1 µF capacitor.
µ §
Each IC need to be decoupled in medium frequency , but only one out of 4 IC's must be decoupled in high frequency
The design of the circuit board must include sockets , resistors , capacitors , and IC's .
To save area the circuit board is cut in two parts .
The first is the Device Interface .
The second is the Memory , Modem Interface , Clock ,Microcontroller .
They are connected together by a 20-way IDT Ribbon Cable and rt angle
mounting male header .
Scheme of the connections
µ §
To design this circuit board a package has been used : Easy-PC
EASY-PC PACKAGE
EASY-PC is an easy-to-use Printed Circuit and Schematic Drawing package designed to speed up the process of creating and editing PCB layout and circuit schematics while avoiding the tedium associated with the old stick-down pad and tape or stencil methods .
Main Features
Ideal for the creation and editing of printed circuit board layout
Amazing Speed - Even on standard PC's
True pad shape and size shown on the screen
True track width shown on the screen
Up to eight track layers available
Two silk-screen layers available
Full library facilities
Output to standard dot-matrix printer
Easy-PC requires an IBM PC, PC-XT, PC-AT with CGA and a n appropriate monitor.
A minimum memory size of 512 K bytes is necessary .
5.2 CIRCUIT BOARD
6 METHOD&OPERATION
6.1 Board Process
The PIC 16C55 is a single-chip microcomputer with EPROM, RAM,I/O and a central processing unit .
The microcontroller manages all the IC's on the board , directly or by the EPROM .
After Pic I/O pins ,the 8251A are configured ,and counters are initialized , the board is ready to work . (We'll see later how to program this Board Boot ) .
Port Configuration : ( see PIC Pin Configuration - 4.7.2 )
Port A serve to select one or no device to communicate with.
Port B is link to the data bus :
We can read data bus content or write into the data bus by this port .
The port C is divided into 2 parts :
Bits 0 to 3 serve to select a EPROM function .
Bits 4 to 7 have individual configuration .
EPROM Function : ( see EPROM Programmation - 4.7.1 )
The EPROM contains 16 preprograming functions use to initialize , configure or control board IC's .
To do something we must choose the right EPROM function .
and to select it by writting the function number on the Port A of the PIC.
Examples : _ the function '1' reset the 3 Ram Counters .
_ the function '3' load Informations through the data bus into counters .
_ the function '8' allows Pic to read the Ram .
Data Bus :
All IC's ( except Timer 555 and the 10-to-4 decoder) are linked with the Data Bus . Some can only read information through the Data Bus , some other can read and write treough .
The data bus is very important , cause it carrys all the information that the board handles .
Examples : The Ram counters cann load a number trough the Data Bus
The Data from or of the Devices are carryed bu the Data Bus
The PIC can Configure the 8251A by through the Data Bus
Device Selection : ( see Devices Interface - 4.3 )
The board can be connected to 8 devices and each device has 8 bits of data + 2 bits of command .The board can't read or write (R/W) 10 bits in one time .
In fact by the port A we can select to R/W Data byte of a device or command bits of 4 devices together :
Device Select/Address Data R/W
0 Command 2-bits of device 1,2,3,4 together
1 Data byte of device 1
2 Data byte of device 2
3 Data byte of device 3
4 Data byte of device 4
5 Command 2-bits of device 5,6,7,8 together
6 Data byte of device 5
7 Data byte of device 6
8 Data byte of device 7
9 Data byte of device 8
10 The devices are isolated
.... ..................................
.... ..................................
15 The devices are isolated
To R/W the command 2-bits or Data Byte of a device ,the board must select one of this address .
Remark : If the board selects the EPROM function 6 or 7 and the Port A selects an address between 10 and 15 then All IC's are isolated from the PIC.
It's the only way to completely isolate the PIC 16C55
6.2 Algorithms & Programs
We have seen the process of the board , so now we can program the PIC .
BOOT program
This program initializes the PIC ports , configure the 8251A and reset the Ram Counters .
NOP No Operation
NOP No Operation
MOVLW 0 W=0
TRIS 5 Config pins port A : output
TRIS 6 Config pins port B : output
MOVLW 8 W=8
TRIS 7 Config pins port C : output & pin 4 :input
NOP No operation
MOVLW 10 W=10
MOVWF 5 Select no device
MOVLW 0 W=0
MOVWF 7 Function 0 selected : reset 8251A
MOVLW 116 W=116 : mode instruction word (D"01111100")
MOVWF 6 Write on data bus
MOVLW 12 W=12 : command instruction word (D"00000001")
MOVWF 7 Function 12 selected : initialize 8251A
MOVLW 1 W=1
MOVWF 6 Write W on data bus :
MOVLW 1 W=1
MOVWF 7 Function 1 selected : reset counters
NOP No operation
Mode Instrunction Word = D011111100 :
Double sync character + syndet is an input + Even parity generation +
parity enable + character length : 8 bits
Command Instruction Word= D00000001 :
normal operation + receive disable + transmit enable
Store data program
This program store data byte of the devices 1,4 and 6 into the Ram until this is full .
µ §
SUB MACRO I Create the Macro 'Sub' with a parameter 'I'
BTFSC 7,4 If Bit 4 of Port C = 0 then skip next line
GOTO END Go to the label End
BCF 7,5 counter Clock = 0
BSF 7,5 counter Clock = 1
MOVLW I W = I
MOVWF 5 Select device I
ENDM
NOP No operation
MOVLW 4 W=4
MOVWF 7 Select EPROM function 4
DEB SUB 1 Call SUB to control device 1
SUB 4 Call SUB to control device 4
SUB 7 Call SUB to control device 6
GOTO DEB Go to the label DEB
END NOP End Program / No operation
7. DISCUSSION
The project purpose was to Design and develop a communication board between devices and a modem .
The circuit board created can be a good solution to a cheap communication board located anywhere and are specially designed to have a low power consumption . The board is much less expensive and easier to carry or to repair in case of error, than a computer ..
But at the end of the project many points weren't as good as they could be .
Indeed to select the pins the board use a EPROM of 65536 words * 16 bits which costs £11.91 .
In fact the board uses only 16 * 12 bits of the EPROM ,that's 0.183% of the EPROM memorY .
We haven't had enough time to design the second circuit board and to make the practical boards .
Normaly there were 9 weeks to do the project. But when we arrived
the university was on holidays .So really only 6 weeks could be
spent to develop and design the boards .
8. CONCLUSION
The aim of this project was to design and develop a communication board between devices and a modem but to discover a new country and a new working environment .
This project allowed me to :
See a new way of learning and teaching at the University of Central
Lancashire of Preston .
Have work experience in microprocessors .
Know what's like to work for somebody
Understand and speak the english language with greater ease.
Discover a typical English Town , Preston and English people .
9. French Summary
Le but de ce stage de fin d'etude de deuxieme année d'IUT de Mesures-Physiques de Lannion a l'Universite de Central Lancashire a Preston ,fut le developpement d'une carte d'interfacage Appareils-Modem .
Ce stage s'inserait dans le cadre du projet "Station Meteo" : Une batterie d'appareils de mesure de la temperature , du taux d'humidité , ...etc ont été créé pour faire une statistic meteo . Cette station meteo peut etre placer loin du poste centrale de commande .Un ordinateur PC était donc utilisé pour enregistrer les données des appareils et pour en fin de journée envoyer toutes les données au poste centrale par l'intermediaire d'un modem .
Ce stage consistait a developper une carte qui puisse remplacer ce micro-ordinateur ,mais devait pouvoir aussi s'inserer dans d'autre projet .La carte devait etre souple d'utilisation , facilement programmable , et economique .
Le probleme a été divisé en plusieurs parties distinctes :
_ L'interfacage des appareils avec la carte.
_ L'interfacage de la carte avec un modem
_ L'enregistrememt des données
_ Le controle des differenetes parties de la carte par un Microcontroller .
Chaque partie a été étudié en rapport avec les autres pour garder une cohérence dans le developpement de la carte et une compatibilité entre chaque microprocesseur utilisé .
Si l'on retrace le deroulement du projet on pourrait distinguer plusieurs étapes :
Une semaine :
_ Connaissance et conprehension du probléme posé
_ Connaissance du cadre dans lequel s'insere le probleme
Trois semaines :
_ Recherche théorique d'une solution au probleme
_ Recherche des differentes puces et de leurs caractéristiques
Deux semaines :
_ Regroupement des differentes parties : compatibilité, cohérence
La recherche des composants de la carte et de leur fonctionnement a pris beaucoup de temps et surtout il en resulte une grande quantité de documents ,tous indispensables pour la bonne compréhension de la carte et de son fonctionnement .
C'est pour cette raison que le rapport est divisé en deux cahiers disctints. L'un contenant toutes les recherches théoriques et pratiques ,l'autre regroupant l'ensemble de documents utilisés lors de ce stage .
10. ACKNOWLEDGMENTS
This project has been made possible due to the aid and support of the following people.
Many thanks to Dr Peter Bates ,my project supervisor who helped me through out the project and supplied me with a large amount of literature.
To the members of the Physics Stores departememt, for their help in supplying equipment and to the technical & clerical staff for their help, their availability and their precious knowledge : Christine Edwards, Anne Marie Flanagan, Alan Kent, Helen Poulton .
And a great thank to Graham Hitscott who had the patience to check this report
11. BIBLIOGRAPHY
TTL Data Book Texas Instruments
volume 1 : Standard TTL, Low-Power Schottky, Shottky (1989)
volume 3 : Bipolar Programmable Logic and Memory (1985)
Byron W.Putman , RS-232 Simplified , 1987, Prentice-Hall Incorporated
Martin Hartley Jones, A practical introduction to electronic circuits, 1985, Cambridge
Manual of Printed Citcuit Board Design and Schematic Draughting : EASY-PC
RS ,Electronic and Electrical Components November 1992 - February 1993