Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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: 105
Last edited:
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top