Need Help~~ simple serout and serin command, but i receive unknown character in PC


Closed Thread
Results 1 to 5 of 5
  1. #1
    mengckid's Avatar
    mengckid Guest

    Default Need Help~~ simple serout and serin command, but i receive unknown character in PC

    Need Help~~ I write the simple serout and serin command in PIC Basic Pro, but i receive unknown character(like chinese words or ???? things) in my PC, can anyone tell me, how to solve it, thanks u~~

    I am try many ways to solve it,but still cant solve it

    I am using PIC 16F874A model, try a simple coe below:


    serout PORTC.6,T2400,["ABCDE"] 'Display menu on PC screen
    PAUSE 2000

    main:

    PORTB.0=0
    i = 0
    SERIN PORTC.7,T2400,["A"],waikong
    serout PORTC.6,T2400,[waikong] 'Display menu on PC screen
    PORTB.0=1

    goto main



    output receive in PC : unknown character like chinese word or ????

    after i type a word "A" then type send...the led cannot turn on, and i need to disconnect my power supply, and reconnect it again...to see the led light on and off. How could be??

    really need a help~~thanks u...

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


    Did you find this post helpful? Yes | No

    Default

    i don't see any INCLUDE "MODEDEFS.BAS" and/or DEFINE OSC x so what about ...
    SEROUT PORTC.6,0,["HELLO"]

    NO?? what about now
    SEROUT PORTC.6,4,["HELLO"]

    Since this PIC have an internal USART, why you don't use it??? HSEROUT, HSERIN + an external inverter circuit like MAX232.
    Steve

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

  3. #3
    Bob_W's Avatar
    Bob_W Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    Since this PIC have an internal USART, why you don't use it??? HSEROUT, HSERIN + an external inverter circuit like MAX232.
    Assuming you have all the includes, etc. You must already have an external inverter, because you're using T2400. If you don't, that might be when you're getting trash. Also, assuming the LED is on PORTB.0, the LED will turn back off as soon as it turns on because you set the port low immediately making it high.

  4. #4
    mengckid's Avatar
    mengckid Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    i don't see any INCLUDE "MODEDEFS.BAS" and/or DEFINE OSC x so what about ...
    SEROUT PORTC.6,0,["HELLO"]

    NO?? what about now
    SEROUT PORTC.6,4,["HELLO"]

    Since this PIC have an internal USART, why you don't use it??? HSEROUT, HSERIN + an external inverter circuit like MAX232.
    ya..i got include the INCLUDE "MODEDEFS.BAS" and define osc X..in my code. I haven try PIC 16F84A, but i think should be nope problem with the code that i mention above...thats y i am thinking is it PIC 16F874A problem? by using simple serin and serout command...

    By the way, i got include external inverter circuit like MAX232 in my hardware...emmm, just panic now, but i am sure my connection is correct...just receive the weird character only...

    emm..hehe, can u send me the simple code with HSERIN and HSEROUT to test...hopefully, can settle soon...

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,848


    Did you find this post helpful? Yes | No

    Default

    I am sure that with Hserout you will have no problem. Try to set the output BEFORE using the Serout command.

    Ioannis

Similar Threads

  1. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  2. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  3. Sending menu to PC from PIC16F876A
    By joseph Degorio in forum Serial
    Replies: 2
    Last Post: - 12th November 2007, 07:03
  4. Serial interface with RFID reader
    By brid0030 in forum Serial
    Replies: 8
    Last Post: - 23rd January 2007, 06:23
  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