Serial Communication Assembly code -PIC EUSART

Thread Starter

74266

Joined Mar 20, 2016
41
I just want to ask if does anyone have a program in ASSEMBLY FORMAT(low level) that will instruct the DCE to read or write data from or to the LAT, PORT and TRIS A, B, D, and E registers using EUSART (Serial). The DTE will send 2 bytes of information in the following format:
1st byte (register) 2nd byte (data)
 

Attachments

jpanhalt

Joined Jan 18, 2008
11,087
What is or are DCE and DTE? Which microcontroller? Why do you need to do this?

Reading a port or register is simple. Use:
Code:
movf   <name>,w
Once it is in w, they you can do what you want, like move it to the EUSART. Have you made any attempts to solve this question yourself?

John
 

djsfantasi

Joined Apr 11, 2010
9,237
What is or are DCE and DTE?
DTE is Data Terminal Equipment. Originally referred to a standalone dumb terminal device. DCE is Data Communications Equipment. Such as a host computer or modem. The terms are from the 1980s and were widely used in reference to the RS232 standard.
 

jpanhalt

Joined Jan 18, 2008
11,087
@djsfantasi
If that is what the TS meant, then a lot more information is needed , such as the DCE instruction set, since the TS wants that device to query the PIC:
{code} that will instruct the DCE to read or write data from or to the LAT...
I suspect those terms may have been used in a different or more abstract context, as the construct of the question is highly suggestive of a homework assignment. We need the TS to clarify what is needed and what he has already done to solve the assignment.

John
 

MaxHeadRoom

Joined Jul 18, 2013
30,654
@djsfantasi
If that is what the TS meant, then a lot more information is needed , such as the DCE instruction set, since the TS wants that device to query the PIC:

I suspect those terms may have been used in a different or more abstract context, as the construct of the question is highly suggestive of a homework assignment. We need the TS to clarify what is needed and what he has already done to solve the assignment.

John
In original modem use, DCE/DTE (Data Carrier Equipment and Data Terminal Equipment) was a 9 conductor cable connection arrangement for hardware handshake of the Tx & RX equipment Known as a Null Modem cable.
It is rarely used anymore on RS232 equipment, now more common is the S/W handshake code XON/XOFF and a 3 wire cable used.
Max.
.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
30,654
I just want to ask if does anyone have a program in ASSEMBLY FORMAT(low level) that will instruct the DCE to read or write data from or to the LAT, PORT and TRIS A, B, D, and E registers using EUSART (Serial). The DTE will send 2 bytes of information in the following format:
1st byte (register) 2nd byte (data)
This is the XON/XOFF method.
XON\XOFF Handshaking is a software protocol that is used to control data flow.
Suppose that the computer were sending data to an instrument which could accept no more data for the time being - the instrument would send the single XOFF character to the computer which would stop sending data until it received an XON character to restart transmission. The same arrangements would apply for the reverse direction of data flow.

XON is ASCII character 17 and XOFF ASCII character 19.
Should be very easy to implement in Assembly.
Max.
 
Top