Converter Parallel to Serial and Serial to Parallel
This converter can be built up by your
self with cheap cost, this converter primerly builds up by using a microcontroller
89s51 or others family. This converter can convert serial to parallel
or parallel to serial by setting up for pin I/O, this serial format
follows the RS232 rule, with truth table as follow.
Before you can use this converter, you
must programs the device by using a microcontroller programmer, visits
this site for how to build and programs the device : http://www.mytutorialcafe.com/
org 0h call initserial ; start: jb P3.2,p2s s2p: call getin mov P2,a sjmp start ; p2s: mov a,p0; call Sendout sjmp start ;=================================================== ;Subroutine Sendout ;This subruoutine is to send a data from P0 serially ;================================================== sendout: detect: jnb ti,detect; clr ti ; mov sbuf,a ; ret ;=================================================== ;Subroutine GetIn ;This subruoutine is to receive data and sends to P0 ;================================================== getin: detect1:jnb ri,detect1 ; Deteksi bit RI apakah data sudah diterima atau belum clr ri mov a,sbuf 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