16F74, ADRES onto TXREG

Status
Not open for further replies.

imhereithink

New Member
Hi guys,

Another wee problem. Im using the 16F74 with three analogue inputs, these are connected to the A/D mux. The program sends out "AA" then A/D result then "BB" 2nd A/D result then "CC" 3rd A/D result through the TXREG.

What i am recieving on the comms tester is:
"AA RecordSeparator BB RecordSeparator CC RecordSeparator"

As you can see there is no data after the characters. The way i am moving the A/D result onto the Transmit register is as follows:

Test GO/Done, when set A/D is complete,
MOVLW ADRES
Check TXREG is empty
MOVWF TXREG

Is this the correct way to send the ADRES out onto TXREG? I have attached my asm file so you can have a chack at what i am doing and point me in the right direction

Thanks
 

Attachments

  • USART2.asm
    5.3 KB · Views: 110
Last edited:
imhereithink said:
Test GO/Done, when set A/D is complete,
MOVLW ADRES
Check TXREG is empty
MOVWF TXREG

Think what you're trying to do!, and check the section highlighted in red!.
 
i want to move the file into the working register so instead i should use
MOVF ADRES,W? then movwf txreg. Is this right?

Thanks
 
imhereithink said:
i want to move the file into the working register so instead i should use
MOVF ADRES,W? then movwf txreg. Is this right?

Yes, MOVLW is 'Move Literal to W', it simply moves the constant value ADRES to W, you can check the value in the INCLUDE file. It's a simple text replacement, the assembler merely replaces every occurance of ADRES with the number listed in the INCLUDE file - in this case 0x1E.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…