Communications Example : PC to PIC bi-directional dialogue


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    PaulB's Avatar
    PaulB Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie,

    Thanks for the reply.

    I thought that the SERIN and SEROUT were OK, but wanted to check.

    Off topic, I'm really looking for a started guide to the use of PBC. The manual with it gives the syntax of the language tokens etc, but is not clear on use of directives etc and how to change the type of PIUC.

    I thought that I should have simply been able to run your demo throug the compiler and get a HEX file at the end, but it barfs at the first @ directive!

    I'll have a look through the forum again and post a note if I dont find anything.

    Regards

    Paulb

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie...

    I am having a little problem with your program.

    I loaded it into the 16f628a, and it appears the characters are getting to the rx port, but no echo's or messages....


    Hi...

    Sorry it's taken me so long to verify this... just so much work and so little time.

    Worked straight away witha 16F628A out of the box... but... then I tried it on a normal 16F628 (just a random selection from stock)... and I had comms errors!... not all the keys on the keyboard would echo, and those that did were wrong.

    So I recompiled for a 4MHz xtal (Resonator actually using XT_OSC), added the bits... and tried the chip that was giving me problems... whoo-hoo... away it ran without errors.

    This just proves that Async comms even at 300 Baud are not always reliable on internal oscillator. The variances between individual chips are just too great.

    I shall post this on the forum.

    Melanie
    Attached Images Attached Images  

  3. #3
    D-Work's Avatar
    D-Work Guest


    Did you find this post helpful? Yes | No

    Default

    Hello,

    I have a problem with this sample. When a open PICBASIC Terminal and type ON nothing happens but when a type ON 1 the PIC return Bad!.

    Whats seems the problem, i think the PIC works fine because in the terminal i get the Bad! answer from the PIC

    Thanks,
    David

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Please see the previous posts on this thread. You either have the wrong baudrate, or your PICs internal oscillator is out of spec and you need to recompile using an xtal or resonator.

  5. #5
    D-Work's Avatar
    D-Work Guest


    Did you find this post helpful? Yes | No

    Default

    I use the baudrate provided in the source code "300 baud, 8 Data Bits, No Parity, 1 stop Bit, No Flow Control".
    The problem is i get errors while compiling your code, i use version 2.1.3 of Proton+.

    Code:
    Error at Line [112]	In file [COLOK.BAS]		*** Value Expected! ***
    Error at Line [165]	In file [COLOK.BAS]		*** Variable or Value is Missing! ***
    Error at Line [170]	In file [COLOK.BAS]		*** Square opening bracket '[' missing! ***
    Error at Line [183]	In file [COLOK.BAS]		*** Square opening bracket '[' missing! ***
    Error at Line [211]	In file [COLOK.BAS]		*** Syntax error! ***
    Error at Line [247]	In file [COLOK.BAS]		*** Syntax error! ***
    Error at Line [250]	In file [COLOK.BAS]	*** Misplaced or Incorrect 'ENDIF'. Also check its corresponding IF Command! ***
    Regards,
    David
    Last edited by D-Work; - 24th October 2005 at 03:53.

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


    Did you find this post helpful? Yes | No

    Default

    Weird error message if you'd copy/paste the Melanie's code...Be sure you use MELABS compiler.
    Steve

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

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    My examples are NOT written for Proton but for MeLabs PBP and are posted on this forum and on MeLabs website. The code works perfectly when used with compiler it was intended for.

Similar Threads

  1. Send data PIC to PC
    By konter in forum Off Topic
    Replies: 6
    Last Post: - 25th December 2009, 22:04
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. Replies: 11
    Last Post: - 12th July 2008, 02:36
  5. PC / PIC communications?
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th September 2005, 17:55

Members who have read this thread : 1

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