|
|
View previous topic :: View next topic |
Author |
Message |
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
Problem with 12F609 |
Posted: Thu Dec 30, 2010 6:01 am |
|
|
Dear All,
I am using 12F609 device & MPLAB 8.53ver. CCS Ver 4.073.
Logic is,
Whenever Power is made 'ON' PIN A2 should have to be High, then in the loop make PIN A2 HIGH & LOW depends upon PIN A0 & A1 Status.
On the testing Board once the Power is made 'ON' PIN A0 = High & PIN A1 = LOW.
I programmed this into device & put on the board. But When Power is made ON PIN A2 goes High & immediately becomes Low. Actually PIN A0 is High. I tried with 12F629. It works fine. Below is my source code.
Code: |
#include <12F609.h>
#Fuses IOSC4,INTRC_IO,NOWDT,PUT,NOMCLR,PROTECT,BROWNOUT
//Internal RC Osc, no CLKOUT,No Watch Dog Timer,Power Up Time ON,Internal MCLR,Code Protect ON,Brownout detect ON,
//************** function prototypes *********************************************/
void init_CPU(void);
void init_CPU()
{
/**************** PORT SETTINGS ***********************/
OUTPUT_A(0X04); //Initially make o/p low
PORT_A_PULLUPS(0X00); // diable internal pullups,bcz external pull ups are connected.
SET_TRIS_A(0X13); //0001 0011 I/P = GP1,GP2,GP4 O/P = GP0,GP3,GP55.
SETUP_COMPARATOR(NC_NC_NC_NC); // comparator off
//SETUP_ADC(ADC_OFF);
//SETUP_ADC(VSS_VDD );
}
void main()
{
int16 i;
for(i=0;i<30000;i++); //Dealy TO Stable VDD
init_CPU();
OUTPUT_HIGH(PIN_A2);
while(TRUE)
{
while(INPUT(PIN_A0));
OUTPUT_LOW(PIN_A2);
while(INPUT(PIN_A1)== 0);
OUTPUT_LOW(PIN_A2);
}
}
|
Please help me to solve this problem _________________ Thank You,
With Best Regards,
Deepak. |
|
|
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
Solved:Problem with 12f609 |
Posted: Fri Dec 31, 2010 4:46 am |
|
|
With reference above post I made following changes in the code,
#byte ANSEL = 0x9F
#byte OSCTUNE = 0x90
with this change my problem is solved
Thanks to this forum ! _________________ Thank You,
With Best Regards,
Deepak. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|