PICcoder.co.uk Forum  


::post new topic::
PIC Programming
Date: 2006/08/31 16:10 By: Riaan Status: Visitor  
 
I have to Program a PIC18F4550 to receive a byte from the PC through the usb port, put some lights on, send that to another PIC18F4550 , modify it and send that back to the PC thorought the first pic.

I am new to PIC programming and dont reaaly know where to start, the code by Mat Clayton works fine, but how can I modify it? Please help
reply | quote

Re:PIC Programming
Date: 2006/09/02 17:06 By: dariog Status: User  
Karma: 6  
Posts: 107
graphgraph
hmmm, well, Riaan, from your post it seems that you have already used and (probably!) understood Mat's code.

So, as to switching on a light with a command from the Pc is OK, and so it should be sending a byte back.
As for communication among 2 18F4550, probably the most correct way would be to use PSP (parallel slave port) which basically is PORTD with some control pins. This is good (and fast) if you can wire 10 pins together, and dedicate those pins to ONLY that purpose.
Otherwise a RS232 with USART would be ok, you don't even need to use RS232 level shifter, just connect RC6-RC7 cross-together and you're done.

The rest.. is up to you!
reply | quote

Re:PIC Programming
Date: 2007/05/08 04:58 By: sean Status: Visitor  
 
Hello,
Parallel communication between two 18f4550's using PSP sounds great, but it looks like this PIC offers SPP (Streaming Parallel Port) functionality which offers a (isochronous-only) USB control, or control via microcontroller on PORTD. Unlike the PSP examples that i have seen however, i don't see any way to use SPP for handshaking so that it would be robust in the case that one of the PICs had to service a USB interrupt (there is no IBF, OBF, etc.)
Anyone know of any examples of low latency yet robust parallel communications between 18f4550s? Or perhaps one of the serial modes could actually be comparable as far as speed?

Thank you
reply | quote

Re:PIC Programming
Date: 2007/05/15 10:49 By: dariog Status: User  
Karma: 6  
Posts: 107
graphgraph
Well, SPI master can work up to some 10 MHz on PICs, and they should be able to work as slave up to 4MHz (IIRC). So this can be fast enough for you

The PSP should also be a good method, with or without relating to USB isochronous.
reply | quote

Re:PIC Programming
Date: 2008/06/16 09:46 By: sss Status: Visitor  
 
dariog wrote:
hmmm, well, Riaan, from your post it seems that you have already used and (probably!) understood Mat's code.

So, as to switching on a light with a command from the Pc is OK, and so it should be sending a byte back.
As for communication among 2 18F4550, probably the most correct way would be to use PSP (parallel slave port) which basically is PORTD with some control pins. This is good (and fast) if you can wire 10 pins together, and dedicate those pins to ONLY that purpose.
Otherwise a RS232 with USART would be ok, you don't even need to use RS232 level shifter, just connect RC6-RC7 cross-together and you're done.

The rest.. is up to you!
reply | quote

::post new topic::