View previous topic :: View next topic |
Author |
Message |
atomy_kwang
Joined: 28 Jun 2008 Posts: 24
|
Problem about timer of PIC |
Posted: Fri Aug 29, 2008 4:41 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Fri Aug 29, 2008 8:18 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
atomy_kwang
Joined: 28 Jun 2008 Posts: 24
|
|
Posted: Fri Aug 29, 2008 8:43 am |
|
|
yes i use baud 9600,N,8,1 |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Aug 29, 2008 9:26 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Aug 29, 2008 12:00 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|