serin string question


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Posts
    92

    Default

    Thanks for the help so far,
    I can send from pc to pic and rx from pic using the code below with the settings I first posted and the pic does reply "got it" when I enter an "f".

    CODE:

    loop:
    SerOut tx_pin,N9600,["waiting for f ",10,13]
    SerIn rx_pin,N9600,["f"]
    SerOut tx_pin,N9600,["got it",13,10]
    GoTo loop


    This works most of the time. But yes, I will change to a external osc and I don't have to use a 12F675, I have some 16F628A's and some F84's.

    I really need to have an example,any example of the correct syntax to recognize and reply to a defined string of char's.

    Thanks again,I'm trying to get my brain around working with serial.

    Sam

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

    Default check this out


  3. #3
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by Sam
    Thanks for the help so far,
    I can send from pc to pic and rx from pic using the code below with the settings I first posted and the pic does reply "got it" when I enter an "f".

    CODE:

    loop:
    SerOut tx_pin,N9600,["waiting for f ",10,13]
    SerIn rx_pin,N9600,["f"]
    SerOut tx_pin,N9600,["got it",13,10]
    GoTo loop


    This works most of the time. But yes, I will change to a external osc and I don't have to use a 12F675, I have some 16F628A's and some F84's.

    I really need to have an example,any example of the correct syntax to recognize and reply to a defined string of char's.

    Thanks again,I'm trying to get my brain around working with serial.

    Sam

    If you're using the internal oscillator and it's messing up some of the time, switch to a lower baud rate. That might cure most of the problem. Also, try adjusting your OSC_CAL value. If you don't want to do that, use SEROUT2 instead of SEROUT. With that command, you can 'fine adjust' your baud to compensate for your oscillator being a bit out of whack.
    I forget which-is-which, but I think if you get overrun errors, you're clock might be running fast, framing errors mean the clock is a bit slow (on the PIC that is).

    JDG

  4. #4
    Join Date
    Mar 2004
    Posts
    92

    Default

    Thank you all for the advice you've given me!

    I did switch from intrc to XT ceramic 4mhz and that did it! I've been able to do allot of the things that just wasn't working before changing to XT. I also did start at lower baud rates as advised here and increased them as I made sure things were working correctly.



    Thanks and best regards,
    Sam

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

    Default

    Steve

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

Similar Threads

  1. serin question?
    By sachymo in forum General
    Replies: 5
    Last Post: - 27th July 2008, 10:04
  2. SERIN from a large string
    By earltyso in forum Serial
    Replies: 5
    Last Post: - 2nd May 2008, 22:23
  3. Simple question about Serin..
    By Donat in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th March 2008, 16:26
  4. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 04:39
  5. 16f872. config ports and serin question.
    By kitcat in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th July 2005, 03:03

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