- 28/10/2018 at 13:21 #3842
- 28/10/2018 at 19:43 #3847
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:
- You must set the Virtual Terminal Baud rate the same as the baude rate you set in your code.
- The OSCCON=0x76; is incorrect for 8MHz, please read your PIC datasheet on page 28. It should be 0x66 or 0x67
- 06/11/2018 at 18:45 #3910
I checked the datasheet and there was binary 110 number which refers to 8 MHz.What should I write instead of OSCCON = 0x076
- 07/11/2018 at 20:58 #3911
1110=0x70 in hexadecimal and when I write this OSCCON=0x70 I get the same error.Please help
- 07/11/2018 at 21:05 #3912
This time it gives the error in the image when I write OSCCON=0x067 or OSCCON=0x066.
- 08/11/2018 at 16:01 #3914
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
- 08/11/2018 at 16:05 #3915
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.