serin string question


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Posts
    92

    Default

    Hi Joe,

    Thanks for the reply, that does compile ok but it doesn't work,seems to keep sending data in a loop very fast by looking at the rx LED but nothing shows in hyperterminal.

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Is there a level converter (MAX232 type) between the PIC and the PC?
    If there is, change the N9600's to T9600. If not, your PC might have a problem receiving the 'weak' 5v RS232 coming from the PIC and you might have to use a MAX232 to get the PC to receive it. I know I almost have to use a MAX232 with my laptops and one of my newer desktops. But one of my 'old' desktops will take a 5v RS232 signal without a problem.
    JDG

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

    Default

    Bad config fuse setting, 9600 baud, using internal OSC AND with Serout combination??? no big chance that it's going to work.

    At least fix your config fuse setting, try with a lower baudrate first and use DEBUG.

    Sure it's compile OK probably you're using PM to compile AND those
    Code:
    _CONFIG
    _INTRC
    _OSC
    _NOCLKOUT
    _WDT_ON
    _PWRTE_ON
    _MCLRE_OFF
    _BODEN_ON
    are considered as Label... not much!
    Last edited by mister_e; - 30th November 2006 at 03:36.
    Steve

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

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

    Default mpasm

    Quote Originally Posted by mister_e
    Bad config fuse setting, 9600 baud, using internal OSC AND with Serout combination??? no big chance that it's going to work.

    At least fix your config fuse setting, try with a lower baudrate first and use DEBUG.

    Sure it's compile OK probably you're using PM to compile AND those
    Hello mister_e,
    I compiled with MPASM, and didn't mess with his fuses except to add _ to config.
    I tend to agree good luck getting any serout to work with internal osc, but as you see I missed that! Too busy fighting bad internet connection also not familiar with 12F series, look like PIA to me. Glad you are helping him. MY question is, did I do the changes in the serin2 correctly?
    JS
    Last edited by Archangel; - 30th November 2006 at 05:18.

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

    Default Hyperterminal

    Quote Originally Posted by Sam
    Hi Joe,

    Thanks for the reply, that does compile ok but it doesn't work,seems to keep sending data in a loop very fast by looking at the rx LED but nothing shows in hyperterminal.
    Hi Sam
    I can send data out from my keyboard using hyperterminal, but to save my butt I cannot receive any using it. Can you configure this with a resonator or a crystal instead of int osc, as mister_e pointed out?
    Quote Originally Posted by mister_e
    no big chance that it's going to work.
    JS

  6. #6
    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

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

    Default check this out


  8. #8
    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

  9. #9
    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

  10. #10
    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