Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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
Activity points
1,925
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?
 

Whether you use internal or external oscillator, in Proteus you have to specify its value. You can't have variable oscillator for uC in Proteus.
 

So is there any other way by which i can test it?
 

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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top