SERIN2 and Proteus Simulation


Closed Thread
Results 1 to 13 of 13
  1. #1
    uuq1's Avatar
    uuq1 Guest

    Default SERIN2 and Proteus Simulation

    Anybody tried PBP Code for SERIN2 with Proteus VSM? I have been trying to simulate the code in Proteus but no success yet.

    uuq

  2. #2
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    here is the code and shematic..
    ..
    http://www.picbasic.co.uk/forum/showthread.php?t=1806
    Attached Images Attached Images  

  3. #3
    uuq1's Avatar
    uuq1 Guest


    Did you find this post helpful? Yes | No

    Default

    I am using the following code for 16F877:

    serialInput var PORTB.1
    RX VAR BYTE[8]

    TRISB=%01000000 'Make PORTB Pin 1 as input

    start:
    pause 200
    PORTB=%11111111 'Just an indicator that the program has started
    pause 200
    serin2 serialInput, 396,[wait("+"),RX[0]]
    PORTB=%00000000
    pause 200

    goto start
    Attached Files Attached Files

  4. #4
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    you don't need to connect xtal and C to drawing. use attachment file..

  5. #5
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    this schema. for rx and tx port ..
    file uploaded
    Attached Files Attached Files

  6. #6
    uuq1's Avatar
    uuq1 Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks alot uludere72.

    Is it necessary to use MAX232 with Virtual Terminal.

    You are right that we donot need to connect the crystal and capacitors in Proteus. But the question is : why do the crystal and capacitors used in the Proteus sample design files?

  7. #7
    uuq1's Avatar
    uuq1 Guest


    Did you find this post helpful? Yes | No

    Talking

    The problem is solved with some minor modifications. Thanks again uludere72.

    I am pasting the code and the design file for others, who may go through the same problem in future.
    Attached Files Attached Files

  8. #8
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    your welcome ...

  9. #9
    uuq1's Avatar
    uuq1 Guest


    Did you find this post helpful? Yes | No

    Question

    Another problem in simulation is that the modifiers cant be used like the statement :

    serin2 serialInput, 396,[WAIT("X"), DEC testWord, WAIT("Z")]

    Any clue about the solution?

  10. #10
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello uuq1,

    What type of program opens a .dsn file that you included in the last zip file?

    Thanks!

    BobK

  11. #11
    uuq1's Avatar
    uuq1 Guest


    Did you find this post helpful? Yes | No

    Smile

    The .dsn file is a design file which is created and simulated by Proteus.

  12. #12
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    u can use like this

    SerIn2 pinin,baud,200,start,[WAIT("X"), STR tempStr\8\"Z"]

  13. #13
    uuq1's Avatar
    uuq1 Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    Got the solution. The error was due to the settings of virtual terminal in Proteus.
    I have added an LCD (in standard 4 bit mode) to display the data received.
    The data being expected by the program is charachters sandwiched between charachters X & Z e.g. X45Z , X458Z etc
    As described in the virtual terminal, the data received is in the form of ASCII charachters.
    I have got alot of help from this forum, therefore am attaching the complete project with this thread to help the future comers of this forum.

    Special Thanks to uludere72.
    Attached Files Attached Files

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