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 support@ccsinfo.com

timer0 problem

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



Joined: 27 May 2010
Posts: 6

View user's profile Send private message Send e-mail

timer0 problem
PostPosted: Thu Jul 08, 2010 8:47 am     Reply with quote

Hello everybody

My circuit works in Proteus but it didn't work on bread board. I share my circuit and software and can someone explain to me about calculating interruption types.

thanks friends


[IMG=http://img576.imageshack.us/img576/4514/adszwg.jpg][/IMG]


this is my code

#include "C:\Documents and Settings\Tunahan\Desktop\deneme\main.h"
#use delay (clock=4000000)
#use fast_io(b)
int i=0;

//****************** Timer0 Kesmesi *****************************
#int_timer0 // Timer0 kesmesi
void timer0_kesme () // Kesme fonksiyonu ismi
{
set_timer0(60); // TMR0 değeri belirleniyor
i++; // i değeri 1 arttırılıyor
if (i==10) // i değeri 10'a eşitse RB0 çıkışı lojik-1 olsun
output_high(pin_b0);
if (i==20) // i değeri 20'ye eşitse RB0 çıkışı lojik-1 olsun ve i değeri sıfırlansın
{
output_low(pin_b0);
i=0;
}
}


/********* ANA PROGRAM FONKSİYONU********/

void main()
{

set_tris_b(0x00);

output_b(0x00);

setup_timer_0(RTCC_INTERNAL | RTCC_DIV_256);
set_timer0(60);


enable_interrupts(INT_timer0);
enable_interrupts(GLOBAL);

while(1);

}


Last edited by orhanli1 on Fri Jul 09, 2010 5:07 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 08, 2010 2:16 pm     Reply with quote

Use a free file upload service that doesn't have "Russian Brides" all over
it. I suggest ImageShack: http://imageshack.us/
Also, post a schematic, not a Proteus file. Many of us don't have Proteus.
If you have a program, post it here in the forum. But make it be short.
We don't want to look at a large program.
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