16F628A Serin timeout and Timer1


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Andrew,

    I am not sure if I fully understand your problem, but let me throw this out to you...

    The SerIn has two things that can help you...

    The Wait until and the timeout.

    I am assuming that the ["A"] (wait until "A" is received, then get the next character) is causing your probem.

    To help get rid of noise, you need to ground the pin with a resister.

    The timeout can be pointed to the place you want to go if no signal is received.

    Serin InputPin, T300, 500, Label,["A"],DataStorage

    500 millisecond timeout and goto Label.

    if ok, put data in DataStorage and continue on.

    What I am not sure about, is if Serin is in receive mode, and is receiving data (good or bad) whether that 500 milliseconds will operate or not. I have not tested it, and I didn't see it in the manual. But I want to assume it is operating.

    Are we on the same page?

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  2. #2
    Rubicon's Avatar
    Rubicon Guest


    Did you find this post helpful? Yes | No

    Default

    Dwyane

    Thanks for the reply and sorry for my lack of clarity. I really must post when I'm fresh and not so late at night.

    I have the Serin wait and the timeout with a pullup resistor and they work fine with the exception that when the receiver is in fact receiving something the timeout fails. I understand that this is just how it is when using the timeout in Serin. Its essentially the same as if you don't have a pull-up/pull-down resistor to eliminate noise - the transducer line/power supply/component noise with high opamp amplification keeps retriggering the timeout.
    SERIN PORTB.0,T300,200,NOSERIN,[CODE],B9

    As the receiver is ultrasonic (currently using a 40Khz transducer) I've found that there are many things that emit ultrasonics at or close to that frequency, enough anyway to keep the PIC Serin timeout retriggering. For instance a previous computers power supply two rooms away from the reveiver kept its Receive Indicator LED flickering and the timeout from working. An additional problem is that a transducer will resonate most easily at a particular frequency, 40kHz for example but it'll also resonate at other frequencies just not as easily - a good cause for me to investigate bandpass filters!

    This is why I'm after a way other than the program cycle to keep a time count and to turn the receiver off to save battery power when stuck in the Serin timeout.

    Do you think the Timer1 part of my first post is a viable option?

    Andrew.

  3. #3
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Lightbulb

    Hello,

    forget the timeout-option in "serin" when you receive rf-transmissions.

    I've build it like this:
    I use Timer1 to measure a timelimit.
    So, start Timer1,
    Repeat receive 1 character trough serin,
    if the character is your lead-in receive the rest,
    until timer1 ends.
    go sleep....

    It may be necessary to slow down the transmitter by using DEFINE CHAR_PACING 1000 because you are using slow software rather than fast hardware!

    For me it it not necessary to receive each transmission!
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  4. #4
    Rubicon's Avatar
    Rubicon Guest


    Did you find this post helpful? Yes | No

    Default

    Thankyou all for your help.

    As the transmitter is only sending the qualifier byte and a single code byte over and over at 300bps I'll drop the Serin timeout and give the Serin Timer1 timeout option a go this weekend.

    Once again thanks.

    Regards,

    Andrew.

  5. #5
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Wink

    Think about some leading bytes ($55) in order to syncronize the receiver...
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

Similar Threads

  1. rfPIC Serin problem
    By gavo in forum mel PIC BASIC Pro
    Replies: 52
    Last Post: - 11th March 2008, 17:52

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