+ Reply to Thread
Results 1 to 2 of 2

Thread: Pic16F628a Usart

  1. #1
    funky gibbon Newbie
    Join Date
    Mar 2009
    Posts
    2

    Default Pic16F628a Usart

    Hello All,
    First post here, so im using a 16f628a to read the bit status on portA and send the value through rs232 to laptop, everything works, but i dont know how to send a numeric value, at the moment i get ascii characters in the term window when what i really want is say 0x80 to apear when bit 7 is high and so on, does that make any sence, im programming in asm, i know the equivalent in pic basic would be $hex to output hex, what im geting is $char
    sorry i havent explained myself well here

    thanks in advance


  2. #2
    Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent
    Join Date
    Jan 2005
    Location
    Michigan, USA
    Posts
    2,521

    Default

    I have used something like this;

    Code:
    ;
    ;  Print byte in W as two ASCII nybbles
    ;
    PutByte movwf   TEMP            ; save byte                       |B0
            swapf   TEMP,W          ; swap nybbles in W               |B0
            call    Hex2Asc         ; process left nybble             |B0
            movf    TEMP,W          ; process right nybble            |B0
    Hex2Asc andlw   b'00001111'     ; mask off left nybble            |B0
            addlw   h'36'           ;                                 |B0
            btfsc   STATUS,DC       ;                                 |B0
            addlw   h'07'           ;                                 |B0
            addlw   0-6             ; ($FA)                           |B0
            goto    Put232          ; print ASCII nybble              |B0
    

+ Reply to Thread

Similar Threads

  1. pic16f628a
    By Kid Neon in forum Micro Controllers
    Replies: 14
    Latest: 12th December 2008, 09:57 PM
  2. PIC16F628A Reset?
    By marting in forum Micro Controllers
    Replies: 18
    Latest: 5th December 2008, 08:31 PM
  3. PIC16F628A USART receiving problem
    By AWHF in forum Micro Controllers
    Replies: 12
    Latest: 15th March 2008, 04:26 PM
  4. some PIC16F628A or any other PIC questions
    By davidbball13 in forum Micro Controllers
    Replies: 2
    Latest: 8th March 2008, 06:21 PM
  5. pic16f628a
    By rakhiwilliams in forum Micro Controllers
    Replies: 9
    Latest: 15th November 2006, 05:17 PM

Tags for this Thread