CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

streaming parallel port
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 27, 2009 4:37 pm     Reply with quote

Look at this diagram in the 18F4550 data sheet.
Quote:
FIGURE 18-1: SPP DATA PATH

It shows that all the following control signals are outputs.
Quote:

CK2SPP
OESPP
CSSPP
CK1SPP

There is no way for another PIC (which is also a master-only)
to receive the clock, or the Output Enable (OESPP) signal.

I'm done with this. I can't help you any more.
urefowei



Joined: 21 Feb 2009
Posts: 10
Location: Philippines

View user's profile Send private message Send e-mail

Streaming Parallel Port
PostPosted: Sun Mar 01, 2009 2:39 pm     Reply with quote

ckielstra, here's your post..
I know that SPP is master mode only,
how come you mentioned it there when the communication is PIC-to-PIC?
Please help..

Smile
_________________
EcPaCo
Ttelmah
Guest







Re: Streaming Parallel Port
PostPosted: Sun Mar 01, 2009 3:40 pm     Reply with quote

urefowei wrote:
ckielstra, here's your post..
I know that SPP is master mode only,
how come you mentioned it there when the communication is PIC-to-PIC?
Please help..

Smile


Because the heading of the thread asked about it?...

Best Wishes
urefowei



Joined: 21 Feb 2009
Posts: 10
Location: Philippines

View user's profile Send private message Send e-mail

Streaming parallel port
PostPosted: Sun Mar 01, 2009 3:59 pm     Reply with quote

So you think its possible to communicate 2 PIC18F4550
through SPP??

Please help..

So the logic becomes one a master, and the other should be the slave..
Am I right about this??

But PCM think its not possible..
See the rest of the thread and please figure out..
We need your help..

If so, how can we make/configure the other PIC to become the slave??
_________________
EcPaCo
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sun Mar 01, 2009 6:27 pm     Reply with quote

There are many options for inter device communications:
- SPI: serial, uses 3 wires + 1 select per device, max. speed = Fosc / (4 * 8) bytes per second
- I2C: serial, 2 wires, max. (official) speed = 400kHz / 8 = 250kbytes per second
- SPP: parallel, 11 wires, max. speed (from PCM's answer) = Fosc / 5 bytes per second
- Your own protocol: ... ???

You say you have used the SPI hardware already. Creating an SPI master driver in software is a piece of cake, just a for-loop clocking out the 8 bits and toggling the clock pin.

I've never used SPP but with the information given in the datasheet and in this thread it should be no problem to implement the master part. For the slave it is too bad Microchip didn't implement the hardware but it is easy to implement in software. Just poll the strobe line and when it goes active you read in the data. I wouldn't use interrupts for this because of the overhead involved.

As an alternative you might consider the USBwiz chipset from GHI Electronics which incorporates all your wished functionality: simultaneous access to two USB host ports and one SD card.
Just add a small processor, like the PIC, to tell this chipset what commands you want performed, for example to copy A to B.
urefowei



Joined: 21 Feb 2009
Posts: 10
Location: Philippines

View user's profile Send private message Send e-mail

Streaming parallel port
PostPosted: Mon Mar 02, 2009 1:31 am     Reply with quote

ckielstra wrote:
There are many options for inter device communications:
- SPI: serial, uses 3 wires + 1 select per device, max. speed = Fosc / (4 * 8) bytes per second
- I2C: serial, 2 wires, max. (official) speed = 400kHz / 8 = 250kbytes per second
- SPP: parallel, 11 wires, max. speed (from PCM's answer) = Fosc / 5 bytes per second
- Your own protocol: ... ???

You say you have used the SPI hardware already. Creating an SPI master driver in software is a piece of cake, just a for-loop clocking out the 8 bits and toggling the clock pin.

I've never used SPP but with the information given in the datasheet and in this thread it should be no problem to implement the master part. For the slave it is too bad Microchip didn't implement the hardware but it is easy to implement in software. Just poll the strobe line and when it goes active you read in the data. I wouldn't use interrupts for this because of the overhead involved.

As an alternative you might consider the USBwiz chipset from GHI Electronics which incorporates all your wished functionality: simultaneous access to two USB host ports and one SD card.
Just add a small processor, like the PIC, to tell this chipset what commands you want performed, for example to copy A to B.


Assuming we have no alternative, What should we do??
What do you mean when you
Quote:
Just poll the strobe line and when it goes active you read in the data. I wouldn't use interrupts for this because of the overhead involved.

How do you program this?
_________________
EcPaCo
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Mar 04, 2009 6:03 pm     Reply with quote

Quote:
Assuming we have no alternative, What should we do??
What you should do depends on many parameters that we don't know about.
- How many of these devices do you expect to produce?
- How much time do you have for this project?
- What experience does your team have?
- What throughput does your device require?
- etc.

You said you have 2 USB host controllers and 2 PIC processors. Your design will be easier and cheaper with only one controlling processor instead of two.

Transferring huge amounts of data as your application is going to do, is easier and faster when your processor has a lot of RAM. A PIC18 has a maximum of 4kb RAM, this might be sufficient but is tight.

How fast do you want to transfer the data?
I haven't checked, but let's say that a loop reading data from one 8-bit port and writing to another 8-bit port takes 5 instruction cycles.
With a maximum clock speed of 40MHz for most PIC18 processors this results in a maximum transfer speed of:
40MHz / (4 clocks per instruction * 5 instructions) = 2Mbyte/s
Copying a 700mB DIVX file will take close to 6 minutes. Not sure if your customers want to wait that long...

Somewhere you mentioned the use of SPI. Is this used for the data transfer? If yes, than your transfer speed will be 8 times slower.

If I had to do this project I would choose another processor. For example the NXP LPC2103 costs the same as your PIC18F4550 but has 8kb RAM compared to 2kb. If need arises there are other chips in the LPC210x family with RAM up to 64kB while the PIC18 family stops at a maximum of 4kb RAM.
And the processing speed is much higher (0.9 instruction / clock versus 0.25 instruction / clock for the PIC). An LPC2103 at 60MHz executes 54MIPS while a PIC at 40MHz reaches only 10MIPS.
Open source compilers for the ARM processor are available for free.
Guest








PostPosted: Thu Mar 05, 2009 11:29 am     Reply with quote

I dont think we have time to change,
we just have to take the risk.
I hope we can do this
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group