serin and serin2??? need to understand


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    14

    Question serin and serin2??? need to understand

    'using pic16f84

    INCLUDE "modedefs.bas"

    DEFINE CHAR_PACING 1000

    kdg var byte[3]
    i var byte

    pause 2000
    here:
    SerOut PORTA.0,t2400,["input value from 1 to 200",13,11]
    pause 1000

    i=0
    start:
    serin PORTA.2,t2400,[kdg[i]]
    i=i+1
    if kdg[i]==9 then start

    SerOut PORTA.0,t2400,["the value your enter is ",kdg[i],13,11]
    pause 2000

    where is the wrong in my coding?
    how to make the serin accept more that 1 character.?

  2. #2
    Join Date
    Feb 2006
    Location
    johor,Malaysia
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    ok
    i use 2 pic16f84a.

    1 for send variable data. (pic1)
    1 for receive the varia ble data.(pic2)

    pic1

    INCLUDE "modedefs.bas"
    DEFINE CHAR_PACING 1000
    define osc 4

    digit1 var word
    digit2 var word

    digit1=0
    digit2=0
    start:

    if portb.0=1 then
    digit1=digit1+1
    end if

    if portb.1=1 then
    digit2=digit2+1
    endif

    serout porta.0,n2400, ["OK",digit2,digit1] ' send OK 1st, digit2 2nd and digit1 3rd

    goto start
    end

    pic2

    INCLUDE "modedefs.bas"
    define osc 4

    nilai1 var word
    nilai2 var word

    nilai1=0
    nilai2=0

    lcdout $FE,1
    lcdout "ready"
    start:

    serin porta.0,n2400, ["OK"],nilai2,nilai1 ' recieve OK 1st (true),2nd put digit2 to nilai2 and 3rd put digit1 to nilai1

    'for see the input value

    lcdout $FE,1
    lcdout "Nilai"
    lcdout $FE,$CO
    lcdout DEC3 nilai2,DEC3 nilai1

    goto start
    end

    i hope this help u abit
    if u send data( serout) the another must ready to recieve data(serin).
    that is very importent

  3. #3
    Join Date
    Feb 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Smile but....

    thanx

    sorry not mention early about my situation...
    my project is about communicate from PIC to computer
    i'm using hyperterminal to communicate with the PIC.
    but when i try input a number as example 100 or 11.the monitor show only the first digit of input of the number...

    i hope you can explaine more on serin command..


Similar Threads

  1. Serin to Serin2 ??
    By Gixxer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2008, 03:56
  2. Serin vs Serin2
    By The Master in forum mel PIC BASIC
    Replies: 12
    Last Post: - 19th October 2007, 16:50
  3. Serin / Serin2 / Debugin Differences
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th January 2006, 06:32
  4. SERIN SERIN2 Timeout
    By markedwards in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd June 2005, 18:59
  5. serin and serin2
    By rastan in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd January 2005, 13:10

Members who have read this thread : 2

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