Dear al hand
Sometime we want transmit our data to the point that locatedat at long distance for our computer. It means that we must use serial port .
Before we proceed the project further, one big think that always must be remember, that computer process its data in pararel format default. Another one that we must concern, is standard voltage for serial data transmission is different with TTL voltage.
In order to convert from serial voltage standard in to TTL we use ic converter MAX22, and in order to convert serial data into parael data, we use mic 89s51
Image below shown the main concep of circuitry to send data from an ADC to a computer.
Step 2: Make the program, we can use assembly editor to write this program:
org 0h
call initserial
;
start: mov a,p2; pick data from adc
call Sendout; call sendout subs
sjmp start
;
Sendout:
detect: jnb ti,detect;
clr ti ;
mov sbuf,a ;
ret
;
initserial:
mov scon,#52h;initialize serial mode 1
mov tmod,#20h;timer1 mode 2
mov th1,#0F3h;Reload value for baud rate 2400
setb tr1
ret
end
Compile it to hex, then download it to the AT89s51 flash rom (using downloader).
This program will send 8 bit data to the RS 232 converter.
No comments:
Post a Comment