View previous topic :: View next topic |
Author |
Message |
khalid ezz
Joined: 31 Aug 2014 Posts: 6
|
problem with oscillator |
Posted: Wed Nov 05, 2014 4:38 pm |
|
|
hi
When i make a new project and run it with proteus it shows that one of the oscillator pin as gray. I guess it means float and the circuit doesn't work.
I don't know if the problem is from the ccs code or from proteus, i have previous projects and its work fine.
here is the ccs code
Code: |
#include <16f876a.h>
#use delay(clock=10000000)
#fuses HS,NOWDT,NOLVP,NOPROTECT
#include "nokia.c"
//************************************************
//MAIN
//************************************************
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
//_______start main menu_______
set_tris_b(0x07);
output_b(0x00);
nokia_init();
while(1)
{
nokia_gotoxy(1,1);
printf(nokia_printchar," Praying Time ");
nokia_gotoxy(1,2);
printf(nokia_printchar," system ");
delay_ms(2000);
}
} //end main
|
I want to add a picture for the simulated circuit showing the gray pin but i don't know how. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9220 Location: Greensville,Ontario
|
|
Posted: Wed Nov 05, 2014 5:08 pm |
|
|
Proteus is well known to be 'busted'. Full of errors,flaws, and faulty DRCs.
Though I may sound like a broken record...get a real PIC, a breadboard and wire up real components and test your code that way.
Since you say 'other projects worked', go back to the last known good project, make ONE change, recompile,retest and see what happens..
You couldn't pay me to begin to try to fix Proteus, life is way too short !
Jay |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Nov 05, 2014 5:30 pm |
|
|
Regarding the image posting question, go here:
http://postimage.org/
Upload your image. Select family safe. Then click the first button for
Hotlink to Forum to get a link to the image.
Then go to the CCS forum and type Ctrl-V to paste the link into a post.
If that website doesn't work in your country, then use Google to find
another free image hosting site for forums. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19494
|
|
Posted: Thu Nov 06, 2014 1:25 am |
|
|
Also, the pin being grey, wouldn't stop it working.
Proteus _ignores_ the oscillator, and just accepts what you tell it in it's setup. So long as you tell it the chipp is being clocked at 10Mhz, it'll accept this even if the clock couldn't work. This is one of it's problems.
You don't tell us what pins you are trying to use to talk to the Nokia display, but I'd guess that possibly RC3, RC4, or RC5 are involved?. If so, there is a line wrong in your code, that would stop these from working.... |
|
|
khalid ezz
Joined: 31 Aug 2014 Posts: 6
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|