Classic


Closed Thread
Results 1 to 3 of 3

Thread: Classic

  1. #1
    Haggar's Avatar
    Haggar Guest

    Red face Classic

    well my program compiled smoothly but it didnt work as I expected.. here it is .. "btw iam a newbie .. and this is my first atempt to use the thing" ..

    #################################################
    Define loader_used 1
    include "modedefs.bas" 'include serout defines
    clear

    init:
    TRISB=%00000000 'all ports B output
    TRISA=%11111111 'all ports A input
    TXEN var PORTB.0
    PWRUP var PORTB.1
    TXP var PORTB.2
    RXP var PORTA.0 <--- here is the pin where I recieve the serial data from
    LED var portb.3

    EYEMOD1 var Byte
    RXDATA var byte
    TXDATA VAR BYTE
    CHILD1 var byte

    num var Byte
    PORTB=%00000000
    EYEMOD1=%10110100
    CHILD1=%00000011
    RXDATA=%00000000

    main:

    Receive:

    High PWRUP

    LOW TXEN

    Pause 3

    Serin RXP,T9600,1000,Standby,["A"],RXDATA <<--- iam suspecting this

    if RXDATA=EYEMOD1 then

    goto transmit
    else

    LOw PWRUP

    PAUSE 2000

    goto Receive

    endif


    Standby:
    Low TXEN
    Low PWRUP
    Low led
    pause 5000
    goto Receive

    Transmit:
    High PWRUP
    HIGH TXEN
    pause 3
    TXDATA=RXDATA | CHILD1
    Serout TXP,T9600, ["A",TXDATA]

    PAUSE 1000
    goto Standby

    END
    ################################################## ##

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Could thousands things here

    BUT...

    what about your pic #. More than often, there's analog pins on PORTA (ADC or Comparator). If so, you must disable, at least, this/those lasts on your PIC Serial Data Input.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Haggar's Avatar
    Haggar Guest


    Did you find this post helpful? Yes | No

    Default

    PIC16F877 .. this is the one ..

    I have two of them communicating with each other using serin/serout the out put of the sending chip was varified to be as "A" + 10110100 using the Oscilloscope.

Similar Threads

  1. Old classic If-Then...
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 3rd November 2008, 07:46

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