| View previous topic :: View next topic |
| Author |
Message |
tong143
Joined: 09 May 2011 Posts: 14
|
|
Posted: Sun May 15, 2011 12:42 pm |
|
|
I already have a board with PIC16F72. I can not go for new board. Can you suggest me a PIC which can be used with the same board and pickit2.
| PCM programmer wrote: | You're right. I think Microchip lied. The link that I posted says they
support the 16F72 with Pickit 2 in vs. 8.66. But then if I go to the Select
Device screen in MPLAB vs. 8.66, it says no support for Pickit 1 and
Pickit 2. Only Pickit 3 is supported.
My advice is to choose a different PIC. Use the Configure / Select Device
screen in MPLAB to see what devices are really supported for Pickit 2.
Then buy a PIC that is supported. |
|
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
 |
tong143
Joined: 09 May 2011 Posts: 14
|
|
Posted: Sun May 15, 2011 1:05 pm |
|
|
So It will not have any issues with the board, will it?
|
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun May 15, 2011 3:06 pm |
|
|
The pinouts are the same. The only issues that might exist can be solved
by programming, which is easy. |
|
 |
tong143
Joined: 09 May 2011 Posts: 14
|
|
Posted: Thu May 19, 2011 2:04 pm |
|
|
Hi
To start with I have written a program using mikroC, for pic16f882 using 4 MHz external crystal oscillator, to increase and decrease a number based on input from RA1/RA2 and display on multiplexed 7 segment display. 1s position is controlled by RA3 and 10s position is controlled by RA4. It is a common cathode. I am usin real pic simulator for simulation. The sequence is not followed while increase or decrease operations and both the digits are showing the same value. Following is the program. Shall someone help me on this.
unsigned char seg[10]={0x80,0xf2,0x48,0x60,0x32,0x24,0x04,0xF0,0x00,0x30};
unsigned short i, DD0=0x80,DD1=0x80;
unsigned int tc,k=0,t1c;
void display_temp(short DD0, short DD1)
{
for (i=0;i<1;i++)
{
TMR1IE_bit=1;
while(!TMR1IF_bit )
{
PORTC = seg[DD0];
PORTA.f3= 1; // Select Ones Digit
PORTA.f4= 0;
delay_ms(1);
PORTC = seg[DD1];
PORTA.f3= 0;
PORTA.f4= 1; // Select Tens Digit
delay_ms(1);
if(PORTA.f0==1 || PORTA.f1 == 1 || PORTA.f2 == 1)
{
TMR1IE_bit=0;
TMR1IF_bit=0;
break;
}
}
TMR1H=0x9E; //begin with 0
TMR1L=0x58;
TMR1IE_bit=0;
TMR1IF_bit=0;
if(PORTA.f0==1 || PORTA.f1 == 1 || PORTA.f2 == 1)
break;
}
return;
}
void main()
{
int tc=0,count=0,set=0, t1,t1c=0;
GIE_bit=1;
TRISA=0xE7; // Set PORTA
TRISC=0x01; // set PORTC as OUTPUT except pin0
PORTA=0x00;
PORTC=0x80;
ANSEL=0x00;
ANSELH=0x00;
T1CON=0x01; //tmr1on bit is set
TMR1H=0x9E; //begin with 0
TMR1L=0x58;
while(1)
{
if(PORTA.f2==1)
{
if(tc==0) tc=67;
else tc--;
}
if(PORTA.f1==1)
{
if(tc==67) tc=0;
else tc++;
}
DD0 = tc%10;
DD1 = tc/10;
display_temp(DD0,DD1);
TMR1IE_bit=0;
TMR1IF_bit=0;
}
} |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 19, 2011 2:07 pm |
|
|
| Quote: | I have written a program using mikroC
|
If you are using MikroC you should ask questions on the MikroC forum:
http://www.mikroe.com/forum/
Apparently all this time you were using MikroC. You never said you
were using CCS. You definitely need to move to the MikroC forum. |
|
 |
|