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

Problem about timer of PIC

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



Joined: 28 Jun 2008
Posts: 24

View user's profile Send private message

Problem about timer of PIC
PostPosted: Fri Aug 29, 2008 4:41 am     Reply with quote

i have a 51 code about timer & interrupts
that i would like to ask you .
now i have found a way to solution it.

this is my problem :

TMOD=0X21;
TH0=OXDC;
TL0=0X59;
EA=1;
ET0=1;
TR0=1;

i am try to read 51 mcu book . i understand a little
i would like to write it in CCS C, but i dont know Register that i must use.
How i define it ?


Could you help me ?

ps. In CCS C i use Pic16F877A with 20 MHZ clock.

Thank you very much.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Fri Aug 29, 2008 8:18 am     Reply with quote

These are interupts for serial communication. I think..
Quote:
TMOD=0X21;
TH0=OXDC;
TL0=0X59;
EA=1;
ET0=1;
TR0=1;


So you want Pic16F877A with 20 MHZ clock.

What baud do you want serial communication at? ... 9600,N,8,1
atomy_kwang



Joined: 28 Jun 2008
Posts: 24

View user's profile Send private message

PostPosted: Fri Aug 29, 2008 8:43 am     Reply with quote

yes i use baud 9600,N,8,1
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Aug 29, 2008 9:26 am     Reply with quote

The 8051 processor is very different from the PIC processor.

You have to choose, PIC or 8051. You can not use a book for one and a compiler for the other.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Aug 29, 2008 12:00 pm     Reply with quote

With CCS C, you simply write
Code:
#use rs232(uart1, baud=9600)

and use the getc() and putc() or printf() functions. All necessary register settings are provided by built-in function library.
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