PDA

View Full Version : Serial Communication for 16F84A



shirohin
- 15th June 2012, 18:09
Hi,

I have following PBP code. When trying to program this code's HEX file into PIC 16F84 using PIC Kit2, the programs fails to be written. Kindly help.

include "modedefs.bas"
trisb =%00000100
valor var byte
start:
low portb.0
low portb.1
serin portb.2,N2400,valor
if valor == "O" then
high portb.0
else
LOW portb.0
ENDIF
IF valor == "X" THEN
HIGH portb.1
ELSE
LOW portb.1
ENDIF
IF valor == "S" THEN
HIGH portb.0
HIGH portb.1
ELSE
LOW portb.0
LOW portb.1
ENDIF
goto start

financecatalyst
- 16th June 2012, 01:37
I compiled your code and when choosing the programmer PICKIT2 does not get highlighted. You may not be able to program it directly using PICKIT2 through MPLAB. Try loading the hex file using only pickit2 standalone application.

shirohin
- 16th June 2012, 08:28
Hi,

Thank You for your reply. I directly import the HEX file in the PICKit2. Still, the problem appears. Even for me, compilation was no problem and the code compiled successfully in PBP. Only problem is that the HEX file is not getting loaded in the PIC. PICKit2 shows error while loading the HEX file.

Kindly help.

Regards
Shivam

financecatalyst
- 16th June 2012, 10:19
What is the error? Did you tried with another 84A?

shirohin
- 16th June 2012, 16:12
The error is "Verification of configuration failed." I tried other loading other HEX files into the same 84A and they were successfully uploaded, so guess there is no problem with the PIC.

Regards
Shivam

shirohin
- 30th June 2012, 16:58
Hi,

Thanks for your reply. I have figured out that the code is getting written on the PIC, that error is sort of a default, so no harm!!!