[SOLVED] help with proteus using 16f676 in EXTRC mode

Status
Not open for further replies.

ankitvirdi4

Member level 4
Joined
Mar 13, 2012
Messages
70
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
India
Visit site
Activity points
1,928
Guys I want to work with the RC clock in 16f676 for my project. In order to test it i wrote a simple code

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
void main()
{
TRISC=0x00;
while(1)
{
PORTC=0xff;
delay_ms(100);
 PORTC=0x00;
delay_ms(100);
}
}


Testing this in proteus it works even if nothing is connected to OSC1 that is where I am supposed to connect the RC network. How will I know that my controller is in EXTRC mode. I tried changing the config word in proteus still I am facing the same problem. Please help. View attachment test.rar This is the proteus file.
 

Hi,

You normally tell proteus what oscillator speed you want by right clicking on the pic chip, in the properties box enter your oscillator speed.

If you connect a crystal or R/C to the osc pins in ISIS it will simply ignore them when running a simulation, it relies on the Properties box value.

Of all the oscillators you could use, a R/C is the least stable.

Being as that chip has a very good internal 4mhz oscillator why not use that ?
For a real pic chip you must set it to the Internal osc in the config code.

For Proteus just specify 4mhz in the properties box.
 

Yes I know but for some reasons I want to change my system clock during real time so I am gonna use a pot there, I just want to teat my logic thats it.
Is there anyway I can disable the oscillator from the properties?
 

No. Variable clock cannot be tested.


Let us assume that you are doing a adc project. The setting of certain registers used for adc depend upon the value of Fosc. If you Compile code for 4 MHz and then try to run at 20 MHz it will not work. So the same applies to you project. If you use a 1 MHz RC oscillator and then change the freq to 2 MHz during runtime then if you have certain codes like adc, timer, etc... it will fail to work properly.
 
Last edited:

If you want to use variable Fosc just to vary the speed of running light then you can use ADC and variable delay. Vary the ADC input and then use the adc value for variable delay. This variable delay will vary the speed of running light.
 

I am Using 16f505 which doesnt have an ADC module. Actually to be honest I am making a commercial product and people have made it using 16f505 I am trying to do the same. Proteus doesnt have 16f505 that is why I was testing it on 16f676
 

I don't think it is available online. It is a local product. By the way I just made it hardware and it working fine Thanks a lot anyways.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…