View previous topic :: View next topic |
Author |
Message |
amjad_alahdal
Joined: 19 Feb 2013 Posts: 50
|
RX and TX |
Posted: Mon Mar 04, 2013 8:29 am |
|
|
I have a transceiver, it requires me to make 6 pins of the PIC to make it RX and TX. What is the code for that ?
I used the protocol rs232 to set the baud 9600 as required, so now I need more than one pin to be xmit
Thank you |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Mon Mar 04, 2013 8:42 am |
|
|
Hi,
Post a link to the "tranceiver" so that we can have a look at the electrical interface that is required.
In general, you'll need a minimum of three wires, Tx, Rx, and Gnd, connecting a serial device to your PIC. Some serial devices may also require additional lines for 'handshaking', or 'flow control'.
John |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Mon Mar 04, 2013 8:47 am |
|
|
You can't.
However I'd suspect either:
It needs the same signal to multiple pins - if so, either wire them together or add external logic to do this, or:
It is not using RS232, or possibly is using some form of handshaking - in which case the extra pins don't want TX/RX....
So, post a part number or (better) a link to the data sheet of the module, and we may then be able to help.
I see ezflyer said the same while I was typing...
Best Wishes |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Mon Mar 04, 2013 9:27 am |
|
|
Hi Ttelmah,
This issue comes up so often that I think it should be added to the 'sticky' at the top of the forum!
"If you are interfacing external hardware to your PIC, post a link to the hardware datasheet"
Of course, this assumes that the forum users actually read the guidelines at the top of the forum.....
John |
|
|
amjad_alahdal
Joined: 19 Feb 2013 Posts: 50
|
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Mon Mar 04, 2013 9:55 am |
|
|
amjad_alahdal wrote: | https://www.sparkfun.com/products/691 |
That has an SPI interface, not an RS232. Though it does have 6 pins to interface with.
Are you sure this is the correct module? |
|
|
amjad_alahdal
Joined: 19 Feb 2013 Posts: 50
|
|
Posted: Mon Mar 04, 2013 9:59 am |
|
|
I am sorry what do you mean by " Are you sure this is the correct module? " ?
If you mean the link, yes, I'm using this chip.
They even gave an example by Micro-C, I need to make it compatible with the CCS. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Mon Mar 04, 2013 10:15 am |
|
|
OK. Forget #use RS232. This has nothing whatsoever to do with this module, since it doesn't use RS232....
It uses SPI. Now, what PIC are you intending to use?. Most have hardware SPI, but some don't.
You have MOSI (master out slave in), MISO (master in slave out), SCK (serial clock), Three pins that are the actual SPI 'data' interface, then: CSN (a select to say 'I want to talk'), CE, which turns the module round, switching from receive to transmit, and then INT, which is an optional signal you can program to tell 'you' that the device wants to say something.
Look at #USE SPI. Then realise you will have to possibly listen for the interrupt, and control the CE line, but the byte transactions can be done for you by the CCS drivers.
Best Wishes |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Mon Mar 04, 2013 10:36 am |
|
|
http://www.ccsinfo.com/forum/viewtopic.php?t=47351
Above is the link to the driver by user "Eduardo".
I think your understanding of the hardware required to interface to your transceiver is very limited.
Try to read the datasheets and find tutorials on youtube or even directly on Sparkfun.
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
amjad_alahdal
Joined: 19 Feb 2013 Posts: 50
|
|
Posted: Tue Mar 05, 2013 12:51 am |
|
|
ok, thanks ,,
I think I'll check that code |
|
|
|