View previous topic :: View next topic |
Author |
Message |
mkm_imn
Joined: 15 May 2008 Posts: 3 Location: Malaysia
|
Tell me what the problem might be with EPIC programmer ? |
Posted: Wed May 21, 2008 8:39 pm |
|
|
I'm having problems loading CCS code onto a 16F877A. I'm using the EPIC programmer with EPICWIN version 2.30. Adapter output is 12V, 1A. CCS compiler version is 4.023. here's one of the test programs I've tried to load onto the PIC:
Code: |
#include <16F877a.h>
#USE DELAY(CLOCK=20MHZ,CRYSTAL)
#FUSES HS,NOWDT,Noprotect
#byte port_a=5
#byte port_e=6
#byte port_b=7
#define MotorControl_1 input(pin_a0)
#define MotorControl_2 input(pin_a1)
#define BZeroOn output_high(pin_b0)
#define BZeroOff output_low(pin_b0)
//motor control ClockWise direction
#define motorCW_ON output_high(pin_e0)
#define motorCW_OFF output_low(pin_e0)
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
set_tris_a(0xff); //set portA as input
set_tris_e(0x00);//set portE as output
set_tris_b(0x00);
port_e = 0x00;
port_b = 0x00;
IF (input(MotorControl_1))
{
motorCW_ON; //high at pin e0
}
IF (motorControl_2)
{
BOneOn;//high at pin e1
}
}
|
EPICWIN doesn't include 16F877A but does support 16F877. I assume that should'nt be a problem(?)
The program seems to download fine (although at times it gives a configuration programming error), but when I test it on the board by providing a 5V input at pinA0 and pinA1, I get no output at either E0 or E1. I've tried many programs, I've tried two different boards, two PICs, even another adapter.No results. Can anyone suggest what the problem might be?I am told a 16V adapter is ideal for the program downloading. Could it be that the 12V supply is insufficient? |
|
|
mskala
Joined: 06 Mar 2007 Posts: 100 Location: Massachusetts, USA
|
|
Posted: Wed May 21, 2008 8:41 pm |
|
|
From the 16F87x to the 16F87xA models, there was a change in the way Flash is accessed for programming, I forget details, but check the datasheets, you will need to have an appropriate programmer. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Wed May 21, 2008 9:25 pm |
|
|
Can you measure the output of your 12V supply? Frequently the actual voltage, even under load, is usually higher than the stated value. That aside, if the programmer's Vpp voltage is less than 13.5V, don't expect the PIC to properly program. Get a 16V adapter, make sure the EPIC's programming voltage is at least 13.5V, and then try it. It should work then. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 21, 2008 10:09 pm |
|
|
Besides the problem that the 16F877A is not supported by your
programmer, your program has a minimum of 4 to 5 errors in
coding, fuses, and hardware issues. Study other 16F877A programs
in the forum archives and look closely at the PIC data sheet
in the section on registers, and fix the bugs. |
|
|
mkm_imn
Joined: 15 May 2008 Posts: 3 Location: Malaysia
|
|
Posted: Wed May 21, 2008 10:39 pm |
|
|
Thanks for the tips guys...My adapter is supplying 17V...I fixed the error in the program and downloaded meLabs, which supports 16f877A. Still, it gives a configuration programming error after apparently downloading, and I'm still not getting appropriate outputs. What further troubleshooting can i do? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Wed May 21, 2008 10:46 pm |
|
|
Consult the help file for the programmer for some tips to eliminate the error. It is still likely a low voltage issue. You have to probe around on the board - there is one variable resistor on the EPIC programmer. It may need to be adjusted to get the Vpp level right. If I remember correctly, there is an LM317 variable regulator on the programmer, and the variable resistor adjusts its output voltage. Make sure it's at least 13.5V, but also ensure it's not too high either. I'd guess that 14V should be about the max it should be. Also ensure it doesn't fall when the programmer actually attempts to program the PIC. |
|
|
mkm_imn
Joined: 15 May 2008 Posts: 3 Location: Malaysia
|
|
Posted: Tue May 27, 2008 2:38 am |
|
|
I guess it is a power supply issue after all.Actually, the adapter that came with the EPIC programmer was misplaced. I was getting 18V from a 12V adapter. I've switched to serial programming. Things worked. |
|
|
|