help!!!


Closed Thread
Results 1 to 17 of 17

Thread: help!!!

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default help!!

    i wrote this code but it s not working! so any ideas


    N2400 con 0 'Set Serial mode
    T9600 con 2 ' Set serial mode Baud Rate (T = True)
    VARB0 var BYTE 'Define a variable VARB0 of type byte
    TRISA=$FF 'Set port A to 1 (input)
    TRISB=$00 'Set port B to 0 (output)

    loop:
    Serin PORTA.0,2,VARB0 ' B0 = input character Input the data serially from port A, pin0, at a Baud rate of 9600,
    PORTB = VARB0 'send the data in VARB0 to PORTB (output)

    PAUSE 50 'delay 50ms

    Goto loop ' Forever repeat the loop

    END 'end the program

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


    Did you find this post helpful? Yes | No

    Default

    Where your data come from?
    Are you using an inverter like MAX232 ?
    Did you connect the PIC Supply GND to the External world GND?
    What is your crystal speed?
    Did you set your config fuse properly?
    Did you tied the MCLR pin to VCC?
    Any schematic or picture of your prototype?
    Steve

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

  3. #3
    Join Date
    Dec 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default help!

    i did used the max232
    i m using 4MHZ oscillator
    my data come out from the rs232

    below is my attachement of the schematic
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    O.K. So How your data is send? I mean... when you send 100 is this the numeric expression 1,0,0 or the ASCII character (wich is "d")?

    can your try

    Serin PORTA.0,2,#VARB0

    What are you using to send your data? Hyperterminal? MCS serial communicator or else?

    4 MHZ crystal is maybe not enough... look in the SERIN/SEROUT section... there's some warning on that. DEBUGIN should work better and provide a wider 'modifier' range.
    Steve

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

  5. #5
    Rhatidbwoy's Avatar
    Rhatidbwoy Guest


    Did you find this post helpful? Yes | No

    Default

    as far as I understand 4MHz is not enough for the 9600 baud. Page 135 in the PBP manual. Second to last paragraph.

  6. #6
    Join Date
    Dec 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default help

    well i m using a vb application to send the byte and it is sent as hexadecimal

    well i ll look for the 4 MHZ oscillator for such a high bauderate.

  7. #7
    Join Date
    Dec 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default help

    hey guys about the 4MHZ not enough for the 9600 baude rate r u sure about it
    ?

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