Can someone tell me if I am going in the right direction?


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Matt, do you have the 2 LABX boards hooked to a common power supply? You should have a common ground between them. ADCON0=0 disables A/D too
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Jun 2008
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    Yes, I have a common ground. What do I want for my ADCON settings?

    Right now I am using the codes that where given to me by skimask, unchanged.

  3. #3
    Join Date
    Jun 2008
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    Well guys, thanks again for your time, it's unimaginably nice to have people to ask questions, instead of manuals...Lol. But I need to sleep, I have a rather large amount of family events to contend with tomorrow, so I need to turn in. Hopefully sleeping on it will give me an idea.

    Matt

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Alright...time to completely forget ALL about this serial business...
    TX Side:
    Code:
    DEFINE OSC 20                   'Defines oscillator rate
    ADCON1=$ff : Output PortD.0 'output on PortD.0
    LOOP: PortD.0 = 1 : pause 500 : PortD.0 = 0 : pause 500 : goto loop
    END
    Should flash an LED connected to PortD.0 once per second, 1/2 on, 1/2 off...

    RX Side:
    Code:
    DEFINE OSC 20
    temp var byte : Input PortB.7
    Loop:
    if PortB.7 = 1 then 'checks logic level on Portb.7
    PortB.0 = 1 'if it's high, set B.0 high
    else
    PortB.0 = 0 'otherwise set it low
    endif
    temp = temp + 1 : portB.1 = temp.7 'increase the temp variable, and set b.1 to match the temp variable's bit 7
    goto loop
    END
    PortD.0 on the TX, connected to PortB.7 on the RX.
    LED connected to PortB.0 <- follows PortB.7, which should follow PortB.7
    LED connected to PortB.1 <- should flash quickly showing that the loop is running...if you think it's flashing too fast to see it, change temp var byte to temp var word and change temp = temp + 1 : portb.1 = temp.7 to temp = temp + 1 : portb.1 = temp.15

    If that doesn't work, you've got hardware and/or config problems somewhere and it's time to write a blinky for both individually and get the pins themselves working.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MatthewM View Post
    Yes, I have a common ground. What do I want for my ADCON settings?

    Right now I am using the codes that where given to me by skimask, unchanged.
    ADCON0 and ADCON1 are 2 seperate registers, do different things, related to A/D converters
    ADCON0 = 0 shuts off A/D
    ADCON1 = $FF? i would set as ADCON1 = 6 or 7 , data sheet chart shows all digital with those settings, no VREFs . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Jun 2008
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    I completely redid the code and got it working, using information from this thread, and
    others on this site, finally. I am not sure exactly what was wrong with the other one, but I am assuming it was a config issue, since this code seems to work, maybe the addition of a qualifier too. Regardless, I probably wouldn't have been able to figure it out without your help.

    Thanks for your time and help, it saved me days of flirting with manuals and project books.
    Matt

Similar Threads

  1. Math help - rolling average Wind Direction
    By wjsmarine in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 23rd July 2009, 00:08
  2. How to detect sound direction?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th December 2008, 04:53
  3. Replies: 10
    Last Post: - 8th April 2008, 21:07
  4. Replies: 5
    Last Post: - 12th September 2007, 15:59
  5. Replies: 26
    Last Post: - 2nd January 2006, 18:31

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