View previous topic :: View next topic |
Author |
Message |
Kit Guest
|
How to interface with component with different frequency? |
Posted: Tue Jul 05, 2005 8:16 pm |
|
|
Hi,
Let say, My PIC is run on 4MHz and the 2nd IC is run at 3.579MHz. How to make them communicate is i want the duty cycle of output wave of PIC is in the range of 45% - 55%?
Thanks |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Jul 05, 2005 8:35 pm |
|
|
You didn't give enough details. |
|
|
Kit Guest
|
|
Posted: Tue Jul 05, 2005 8:40 pm |
|
|
Hi
Detail such as? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Jul 05, 2005 8:43 pm |
|
|
Like what in the world you are talking about. It sounds like you want to generate a pwm with a 45%-55% duty cycle and read this with another IC. |
|
|
Guest
|
|
Posted: Tue Jul 05, 2005 8:50 pm |
|
|
How bout using
connect the 2nd IC to the pin which supposed to connect to RS232, and use #use rs232? |
|
|
Guest
|
|
Posted: Tue Jul 05, 2005 8:51 pm |
|
|
How bout
connect the 2nd IC to the pin which supposed to connect to RS232, and use #use rs232? |
|
|
G Guest
|
|
Posted: Tue Jul 05, 2005 9:00 pm |
|
|
How bout
connect the 2nd IC to the pin which supposed to connect to RS232, and use #use rs232? |
|
|
Kit Guest
|
|
Posted: Tue Jul 05, 2005 9:04 pm |
|
|
Basically, I am transmitting the signal in serial using only 1 pin to the 2nd IC.
It is not PWM, I just transmit the data in serial way, between 2 IC run at different clock.
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jul 05, 2005 9:15 pm |
|
|
I think all he wants to know is if can he do RS232 (or maybe SPI)
between two different PICs that have different crystal freqs.
The answer:
Yes, you can.
Use the CCS #use rs232() statement to set a common baud rate,
and let the compiler handle setting up the internal registers to
generate the correct baud rate. |
|
|
valemike Guest
|
|
Posted: Tue Jul 05, 2005 9:49 pm |
|
|
1. What exactly is the 2nd IC? Is it another microcontroller?
2. How far is the second IC from your PIC? On the same board? |
|
|
Kit Guest
|
|
Posted: Tue Jul 05, 2005 11:41 pm |
|
|
the 2nd IC is smart card. well, smart card may contains other microcontroller s.
Yup, they r on the same board.
besides using #use rs232, is there other way to connect to IC running at different clock? Let's say i want to send 8 bit in parallel (for other application)? I am facing this kind of problem, when I want to connect to NIC network interface card which runs at 20 MHz, and my PIC runs at 19.xxxx Mhz .
Thanks |
|
|
Ttelmah Guest
|
|
Posted: Wed Jul 06, 2005 3:44 am |
|
|
Normally devices don't care what frequency the other components are running. The 'interface', will either be synchronous, and have a clock signal the provides synchronisation at this level, or have control pins that again provide synchronisation (so a parallel interface device, will normally require the data to be presented, then a 'read', or a 'write' signal to be generated to actually transfer the data). The only interfaces that require timing generated by one chip to talk to another, are asynchronous connections like RS232 serial, where the devices must both use the same frequency on the interface itself (but again don't care what the actual crystal used to generate this is), to within a margin allowed for in the design of the interface.
Best Wishes |
|
|
|