Hello, this is my first micro-controller project so im not sure whats wrong
Im trying to program a PIC16F877A via serial RS232 port in C and a JDM programmer.
Im using MPLAB and a free HI-TECH C compiler.
Ive looked at many tutorials and they seem to differ a lot from one another or are for assembly language.
I cant get the PIC to program, although im not even sure my code / setup is correct. What ive done so far is:
project > project wizard
device 16F877A
tool suite > HI-TECH Universal Toolsuite
save project
dont add any existing files [they are in assembly and wont compile with C?]
they file>new
save main.c
in main.c [after added to project]
#include <pic.h> //i think thats the right header.
void main()
{
TRISD = 0x00;
PORTD = 0xFF;
}
that should just output 1's on the D port correct? im not sure if my headers are correct, alot of examples use "#use delay <clock=4000000>", but thats throws up an error if i use it.
Then i goto programmer > select programmer
then i have no idea which to use, if i try
MPLAB PM3
with the chip and programmer connected and COM1 set, it says:
"No programmer detected. Please try the current operation again"
or
PICSTART
"PICSTART Plus not found. Please verify serial connection and try the current operation again."
Is my program correct, ive tried this with different IC's and still doesn't work, is my programmer hardware broken?
Thank you in advance
Dominic
Im trying to program a PIC16F877A via serial RS232 port in C and a JDM programmer.
Im using MPLAB and a free HI-TECH C compiler.
Ive looked at many tutorials and they seem to differ a lot from one another or are for assembly language.
I cant get the PIC to program, although im not even sure my code / setup is correct. What ive done so far is:
project > project wizard
device 16F877A
tool suite > HI-TECH Universal Toolsuite
save project
dont add any existing files [they are in assembly and wont compile with C?]
they file>new
save main.c
in main.c [after added to project]
#include <pic.h> //i think thats the right header.
void main()
{
TRISD = 0x00;
PORTD = 0xFF;
}
that should just output 1's on the D port correct? im not sure if my headers are correct, alot of examples use "#use delay <clock=4000000>", but thats throws up an error if i use it.
Then i goto programmer > select programmer
then i have no idea which to use, if i try
MPLAB PM3
with the chip and programmer connected and COM1 set, it says:
"No programmer detected. Please try the current operation again"
or
PICSTART
"PICSTART Plus not found. Please verify serial connection and try the current operation again."
Is my program correct, ive tried this with different IC's and still doesn't work, is my programmer hardware broken?
Thank you in advance
Dominic