Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    HI,
    I am almost finish writing my code and I get an error at the receivring end, I have an LCDout and the sending end, it good number, but at the receiving end the information is confused.
    meaning the Left is showing the same thing as the sending left.
    But the right is showing me number like 12421 (pot at center). I encode and decode he same way, This is weird. what also struck me is that number 12421 is constant, so that when I move my pot there is a variation from 12542 to 12288 .
    I also flipped the serin line for left and right and i get the same result..
    (the sending and show number varying between 0 to 255)
    here is a snippet of the code:

    right var word : left var word : temp var word : counter var byte
    rightold var word : leftold var word : speedright var word : speedleft var word
    loop:
    waitfor55:
    serin portb.2 , n2400 , temp
    if temp <> $55 then goto waitfor55

    waitforaa:
    serin portb.2 , n2400 , temp : if temp <> $aa then goto waitforaa

    serin portb.2, n2400, rightold.LowBYTE : serin portb.2, n2400, rightold.HighBYTE
    serin portb.2, n2400, leftold.LowBYTE : serin portb.2, n2400, leftold.HighBYTE

    For counter=0 TO 7 'decoding
    left.0[counter]=leftold.0[counter*2]
    right.0[counter]=rightold.0[counter*2]
    Next counter

    Lcdout $fe, 1 'Clear screen
    Lcdout "Left: ", Dec left
    Lcdout $fe, $C0, "Right: ", DEC right
    Pause 100

    before you ask, here is my sending part:

    send:
    Lcdout $fe, 1 'Clear screen
    Lcdout "Left: ", Dec left
    Lcdout $fe, $C0, "Right: ", DEC right

    serout portb.2, n2400,[$55,$55,$55,$55,$55,$55,$55,$55,$aa]

    serout portb.2, n2400,[rightnew.LowBYTE,rightnew.HighBYTE]
    serout portb.2, n2400,[leftnew.LowBYTE,leftnew.HighBYTE]

    goto loop
    end
    Last edited by lerameur; - 11th January 2007 at 17:54.

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    it works now, changed some word to byte ...

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Hey , I just realize that after running my receiving circuit for a minute or so , he Lm7805 gets very hot, Is this normal ?. on my sending circuit it stays cool.
    I have on the receiving, an lcd, the receiving RF module, a Pic16F877a and an H-Bridge.. The H bridge is running directly from the battery for the Vs. everything is battery operated

  4. #4
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Hey , I just realize that after running my receiving circuit for a minute or so , he Lm7805 gets very hot, Is this normal ?. on my sending circuit it stays cool.
    I have on the receiving, an lcd, the receiving RF module, a Pic16F877a and an H-Bridge.. The H bridge is running directly from the battery for the Vs. everything is battery operated
    Does the LCD have a backlight ?

    If so, try running it from the unregulated power supply after increasing the resistor accordingly.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    yes it does have a backlioght.
    The supply is a 12v battery cannot put that directly on thebattery

  6. #6
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    yes it does have a backlioght.
    The supply is a 12v battery cannot put that directly on thebattery
    Do you have a series resistor between your 5v supply and the LCD backlight?

    If not it will be drawing excessive current which will definately be why the 7805 is cooking.

    If you do have a resistor, then increase its value and drive the backlight from the 12v supply. Search for threads about "backlight", one just resurfaced in the last couple of days.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  7. #7
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    i have a potenetiometer between the 5 v and the LCD, I swiched to the 12v with the pot, and the LCD is finished

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 19:44
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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