|
|
|
Communicating Pic to Pic
|
|
Date: 2006/03/06 10:27
|
By: Greg
|
Status: User
|
|
|
Karma: 0  
|
|
| Posts: 7 |   | |
|
Hopefully I'm in the right section for this, though I'am very much a begginer. This may sound long winded but here goes. I have a couple of 18F4620's that I want to use to communicate with each other across a wireless serial connection. The problem is that on one side of this connection I have the serial data pins already tied up with the ENC28J60. Should I, or is it possible to use the EUSART module and associated pins to communicate serially instead of some how using the other pins tied up with the ethernet communication?
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/06 10:41
|
By: Mat
|
Status: Admin
|
|
|
Karma: 7  
|
|
| Posts: 211 |  | |
|
You have got a few options, you can either use the usart like you said.
The other option if you want to use SPI which I assume you have tied up with the ENC28j60 controller, then you can use the same 3 wires (CLK,DataIn,DataOut) as the ENC and use a different Chip select on the SPI bus.
If these dont suit, let me know and ill go through some of the others. Mat
|
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/06 23:52
|
By: Greg
|
Status: Visitor
|
|
|
|
|
|
|
Thanks Matt for your help. I have just received the ICD2 and 18F4620 in from overseas today. On the wireless serial comms side however I have just noticed that it has only one data PIN wich means that I have to enable the serial comms chip for transmit or recieve. Is it possible to take transmitted data and received data onto the one pin on the 18F4620? Greg
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/07 00:41
|
By: Mat
|
Status: Admin
|
|
|
Karma: 7  
|
|
| Posts: 211 |  | |
|
Are you talking about using I2C or SPI? As SPI should have transmit and recieve data pins. Mat
|
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/07 03:13
|
By: Greg
|
Status: Visitor
|
|
|
|
|
|
|
On the wireless tranceiver there is only one data pin on which you can transceive data, the tranciever is toggled between transmit and recieve mode. My problem is, if I have only one pin to send data to receive data from what would be the best way for me to do this. I did notice the I(squared)C pin but was unsure if it could be used or should another pin on the pic be configured
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/07 08:32
|
By: Mat
|
Status: Admin
|
|
|
Karma: 7  
|
|
| Posts: 211 |  | |
|
Whats the wireless module, could you give me a link to a datasheet? Just wondering if its a single data SPI or if its another protocal entirely. Mat
|
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/08 22:45
|
By: Greg
|
Status: User
|
|
|
Karma: 0  
|
|
| Posts: 7 |   | |
|
G'day Mat Thanks again for your priceless help. Here are the pinouts for the transceiver and associated links.
The question is how do I get TX and RX data into one pin of the 18F4620?? Do I just take it into one of the digital I/O ports, and if so how does the clock come into it.
This board is prefabricated by another company (sparkfun.com I think) and only takes advantage of one of the two data channels available.
The DR1 pin lets the MCU know that it has data ready for it. This enables the data to be clocked in at a different rate to the MCU.
I guess the most important pins are the CE CLK1 and Data.
I haven’t picked the Tx/Rx mode yet (Shock burst or Direct) but I may try the shockburst.
http://www.sparkfun.com/commerce/product_info.php?products_id=153 http://www.sparkfun.com/datasheets/IC/nRF2401A.pdf
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/08 23:02
|
By: Mat
|
Status: Admin
|
|
|
Karma: 7  
|
|
| Posts: 211 |  | |
|
|
could you try uploading the doc again, its the first time someone has uploaded a file to the forum and i dont think it worked.... Mat
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/08 23:10
|
By: Mat
|
Status: Admin
|
|
|
Karma: 7  
|
|
| Posts: 211 |  | |
|
Did you spot this
Its example coding how to use the modules with a pic, you should just be able to modify those routines into your own code. Also it doesnt seem to matter which pins the device is connect to, so the enc28j60 should effect your wireless modules. Mat
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/09 23:37
|
By: Mat
|
Status: Admin
|
|
|
Karma: 7  
|
|
| Posts: 211 |  | |
|
thanks mate, sorry id setup the permissing in the forum wrong (so no files could be uploaded even though they looked like they had been!) Did you try that example pic code, i thought it was pretty self explanitory, let me know if you have issues with it. Mat
|
|
|
|
|
|
Re:Communicating Pic to Pic
|
|
Date: 2006/03/10 02:46
|
By: Greg
|
Status: User
|
|
|
Karma: 0  
|
|
| Posts: 7 |   | |
|
Hi Matt I haven't checked the code yet but will after I finish typing this. I'm actually setting up the development boards this week so I have a little PCB work to do, before I get into the code. Lets see how I go in a couple of weeks. Thanks again
|
|
|
|