Hyper Terminal Displaying Random Characters [PIC to PC via UART]


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Posts
    5

    Default Hyper Terminal Displaying Random Characters [PIC to PC via UART]

    BTw, i am using http://www.cytron.com.my/viewProduct...7nn82zcVu7Ut0=
    , a USB to UART Converter.

  2. #2
    Join Date
    Apr 2011
    Posts
    5

    Default Hyper Terminal Displaying Random Characters [PIC to PC via UART]

    nvm, i got the program right..
    INCLUDE “modedefs.bas” ‘ Serial communication mode definition file
    DEFINE OSC 20 ‘ Oscillator speed is set to 20MHz
    TRISB = %11111111
    TRISC = %10000000 ‘ RC.7 => USART RX pin set to input
    PortC = 0
    SPBRG = 129 ‘ Baud Rate = 9600
    ‘ Variable definition
    ‘ ===================
    ‘
    count01 VAR BYTE ‘ variable to store TXREG content
    TXSTA = %00100100 ‘ Enable transmit and asynchronous mode
    RCSTA = %10010000 ‘ Enable serial port and continuous receive
    mainloop:
    IF (PortB.7 = 1) THEN
    FOR count01 = 1 TO 30
    PAUSE 2000
    TXREG = count01 + $30 ‘ Transmit Data
    HIGH PortD.2
    PAUSE 2000
    LOW PortD.2
    Next
    ENDIF
    GOTO mainloop
    END

    The result displayed in Hyperterminal:
    ASCII Character: 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ; < until the 30th ASCII Character
    referred to page 203, PIC MCU With PICBasic [Chuck Hellebuyck]

    How do i convert the ASCII characters i received via Visal Basic 2010's serial port into integers?

    I used tiktakx's vb coding http://tiktakx.wordpress.com/2010/11...10/#comment-97

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts