Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

rs232 serial communication

Home Forums MikroC Pro for PIC Tutorial Discussions rs232 serial communication

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  Bitahwa Bindu 1 week, 2 days ago.

  • Author
    Posts
  • #3842

    severus snape
    Participant

    Proteus sends the message at the picture below.What skhuld I do? and these are my files

    Attachments:
    You must be logged in to view attached files.
  • #3847

    Bitahwa Bindu
    Keymaster

    Hi.

    Your configuration is incorrect. You are enabling the MCLR but you are not connecting it to VCC. Or you must disable it in Project Menu –> Edit Project. See the attached screenshot.

    When you fix this error, your PIC will run but you will receive wrong characters on your USART terminal because:

    1. You must set the Virtual Terminal Baud rate the same as the baude rate you set in your code.
    2. The OSCCON=0x76; is incorrect for 8MHz, please read your PIC datasheet on page 28. It should be 0x66 or 0x67

     

     

    Attachments:
    You must be logged in to view attached files.
  • #3910

    severus snape
    Participant

    I checked the datasheet and there was binary 110 number which refers to 8 MHz.What should I write instead of OSCCON = 0x076

  • #3911

    severus snape
    Participant

    1110=0x70 in hexadecimal and when I write this OSCCON=0x70 I get the same error.Please help

     

  • #3912

    severus snape
    Participant

    This time it gives the error in the image when I write OSCCON=0x067 or OSCCON=0x066.

     

    Attachments:
    You must be logged in to view attached files.
    • #3914

      Bitahwa Bindu
      Keymaster

      1110 is not 0x70 in Hex, it’s 0x0E. And the OCCON value is not 1110.

      If you read the datasheet on page 28, the value of OSCCON register should be:

      bit 0 and 1= 11 or 10 (to select internal oscillator).

      bit 2= 1: (frequency is stable)

      bit 3=0 Device is running from the internal oscillator

      bit 6 to 4 =110 To select 8 MHz

      So the OSCCON value will be: 1100111 in binary or 0x67

       

    • #3915

      Bitahwa Bindu
      Keymaster

      I tested the code you uploaded with OCCON of 0x66 or 0x67 and your Proteus schematic, it worked fine. Unless you have changed something else again.

You must be logged in to reply to this topic.