Mithun_K_Das
Advanced Member level 3
- Joined
- Apr 24, 2010
- Messages
- 899
- Helped
- 24
- Reputation
- 48
- Reaction score
- 26
- Trophy points
- 1,318
- Location
- Dhaka, Bangladesh, Bangladesh
- Activity points
- 8,252
void main()
{
TRISE = 0x00;
ADCON1 = 0x07;//all digital
CMCON = 0x07;
while(1)
{
RE2_bit = 1;Delay_ms(1000);
RE1_bit = 1;Delay_ms(1000);
RE0_bit = 1;Delay_ms(1000);
RE2_bit = 0;Delay_ms(1000);
RE1_bit = 0;Delay_ms(1000);
RE0_bit = 0;Delay_ms(1000);
}
}
I'm sorry that I did not mentioned about compiler. I'm using mikroC pro for PIC. This compiler have oscillator settings in edit project option.
So no need to write in code
Projetc
Edit project
General setting project
By explicitly configuring the fuses on code you ensure that by dowloading the firmware to target outside the IDE would keep the configuration on the HEX file, regardless what is configured on that window.
Generate the frequency 1HZ.Try to toggle one pin.It will verify your settings.
Regards,
Akshay.
Re-read post #4, which is the simplest way to check what is really happening with the oscillator settings.
sbit LED0_Dir at TRISE0_bit;
sbit LED1_Dir at TRISE1_bit;
sbit LED2_Dir at TRISE2_bit;
sbit LED0 at PORTE0_bit;
sbit LED1 at PORTE1_bit;
sbit LED2 at PORTE2_bit;
void main()
{
ADCON1=0x06; // or 0x07 All digital, NO analog
CMCON=0x07;
TRISE.PSPMODE=0;
LED0_Dir=0;
LED1_Dir=0;
LED2_Dir=0;
LED0=0;
LED1=0;
LED2=0;
while(1)
{
Delay_ms(1000);LED0=1;
Delay_ms(1000);LED1=1;
Delay_ms(1000);LED2=1;
Delay_ms(1000);LED0=0;
Delay_ms(1000);LED1=0;
Delay_ms(1000);LED2=0;
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?