What am I doing wrong?


Closed Thread
Results 1 to 2 of 2
  1. #1
    mankan's Avatar
    mankan Guest

    Thumbs down What am I doing wrong?

    I am trying to test the tx/Rx using PulsIn command. I am sending a pulse by switching high/low a Tx pin and trying to receive the same using PulsIn command.

    But at the receiver, I always see a "0" in ID variable, is there something wrong. But when I place a voltmeter at that particular pin, I do observe a high and low pulse but the same in not shown by ID variable.

    Any hint, suggestion is appreciated.

    Thanks,
    Mankan

    /*********Transmitter Code****************/

    INCLUDE "modedefs.bas"

    SHIFT_VAR VAR BYTE
    TEMP VAR BYTE
    I VAR BYTE



    Loop:

    HIGH PORTB.2
    PAUSE 2000

    HIGH PORTB.4
    PAUSE 250
    LOW PORTB.4
    PAUSE 250

    LOW PORTB.2
    PAUSE 500


    GOTO LOOP

    /**********End of Tx code****************/

    /*********Receiver Code****************/


    INCLUDE "modedefs.bas"

    '* Variable declarations
    ID var WORD
    ST var BYTE
    RxData var st


    DEFINE OSC 4
    CMCON = 7

    INPUT PORTB.1
    Pause 500

    Loop:


    PulsIn PORTB.1,1,ID

    if ID > 0 then
    HIGH PORTB.5
    PAUSE 50

    LOW PORTB.5
    PAUSE 50

    else

    HIGH PORTB.7
    PAUSE 50

    LOW PORTB.7
    PAUSE 50

    endif

    GOTO LOOP
    /********************END******************/

  2. #2
    mankan's Avatar
    mankan Guest


    Did you find this post helpful? Yes | No

    Talking Ignore it..I found the answer..

    Hello,

    Ignore it..I found the answer..

    Mankan

Similar Threads

  1. WRITECODE stores wrong 14-bit word values in FlashMEM
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th June 2009, 04:35
  2. LCD Showes Some Wrong Letters
    By sbobowski in forum General
    Replies: 2
    Last Post: - 23rd September 2008, 19:15
  3. Anyone know whats wrong with this code
    By Bonxy in forum Serial
    Replies: 10
    Last Post: - 9th March 2007, 16:29
  4. ADCIN - AD settings are wrong
    By teverett in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th December 2006, 16:32
  5. HDD IDE ATA 2 interface problems. code wrong?
    By rastan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th March 2005, 16:01

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