CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Help With Ex_freqc

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








Help With Ex_freqc
PostPosted: Mon Oct 02, 2006 8:53 am     Reply with quote

Hi guys
i used ex_freqc code on my pic as is portC.0 the input so the pin is damaged
so i modified the code to

Code:
#bit t1_overflow = 0x0C.2


but that dosen't work for all port from 0x0C.2 - 0x0C.7

i use 16f876A what is the solution !!!

Thanks ,
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 02, 2006 12:38 pm     Reply with quote

Code:
#bit t1_overflow=0x0C.0

That statement doesn't refer to a bit on Port C. It refers to the
interrupt flag for Timer1, in the PIR1 register. Don't change it.
Normally that statement would have been written like this:
Code:

#byte PIR1 = 0x0C
#bit TMR1IF = PIR1.0

Then it's clear that it's a register bit in PIR1, and not just some variable.
CCS doesn't always do their examples in the clearest way for newbies.

The EX_FREQC.C program uses Timer1 in External Clock mode.
It's setup with this statement:
Code:
setup_timer_1(T1_EXTERNAL | T1_DIV_BY_1);


Look in the 16F876A data sheet, at the pin diagram. Notice the label
on pin 11:
Quote:
RC0/T1OSO/T1CKI

That pin is the clock input for Timer1 when it's used in External Clock
mode.

So if you blew out that pin, then you have to get a new PIC.

But, looking at the Timer1 block diagram in the data sheet, it shows
an alternate path, through pin C1 and then through an inverter.
(This is for the Timer1 oscillator). This path is enabled if you set
the T1OSCEN bit = 1. I don't know if this would work, but it might.
The signal would be inverted, so the Timer would clock on the opposite
edge, compared to using Pin C0.

My recommendation is just to get another PIC.
Guest








PostPosted: Wed Oct 04, 2006 9:58 am     Reply with quote

thanks i replaced the pic the portc.0 and c.1 was damaged but i still had a problem i used LCD for the example and i put LCD routines but the LCD still blinking i used a simple delay after the printf statement as follow

Code:
     printf(lcd_putc,"\f   %LU",freq);      //and print frequency
     delay_ms(500);


and the LCD still blinking i want it stable
what is the solution

Thanks
Guest








PostPosted: Wed Oct 04, 2006 12:56 pm     Reply with quote

solved !
it was the lcd_init();

it was inside the loop by wrong Smile

Greetings
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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