Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC Parallel Communication

Status
Not open for further replies.

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
I am thinking of use the Maxim, which offers 8 S & H channels so I will have simultaneous sampling. This IC communicates in parallel with the outside world, with 5Mhz clock makes conversion to max 3,8 uS so I will have a total conversion time of 3.8 * 8 = 30.4 uS + 800ns sampling gives us a conversion time = 31.2 uS so Fs = 1 / 31.2 uS = 32 kSPS per channel. So throughput is 32 kSPS * 8 = 256 kSPS about. Each sample is 1 byte (8-bit ADC) so I need a 256 KByte/s minimum communication speed; Is this thought correct?

If so, can i achieve this speed with pic18f4553 running at 48MHz..?
 

Vbase

Full Member level 6
Full Member level 6
Joined
Apr 7, 2015
Messages
373
Helped
75
Reputation
150
Reaction score
75
Trophy points
28
Activity points
2,036
You'll be able to read the bytes from MAX155 with even slower pic.
Of course you have to check if you have enough time between reading the bytes to process the bytes.
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
You'll be able to read the bytes from MAX155 with even slower pic.
Of course you have to check if you have enough time between reading the bytes to process the bytes.

I want to send the bytes over full-speed USB to PC. Can i achieve to send each byte exactly after the reading or i have to save it locally on PIC or a memory and then send them to PC..?
 

Vbase

Full Member level 6
Full Member level 6
Joined
Apr 7, 2015
Messages
373
Helped
75
Reputation
150
Reaction score
75
Trophy points
28
Activity points
2,036
I want to send the bytes over full-speed USB to PC. Can i achieve to send each byte exactly after the reading or i have to save it locally on PIC or a memory and then send them to PC..?
You can load the bytes to the USB RAM one by one. The USB which is almost independent module will send packets of data to the PC every 1ms.
Full speed USB can send up to about 1MB per second, I don't know how much it is in practice. In the fastest delivery there is no check for errors and it is recommended for applications like audio.
Using USB requires designing your driver for the PC. If you use HID class USB then your PC already has a driver but HID USB is limited to max 64KB/s , not enough for you. Communication class USB or Mass Storage class may give you the speed you need but you need a driver for the PC. I have experience with HID class only and I find if slower than serial RS232.
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
You can load the bytes to the USB RAM one by one. The USB which is almost independent module will send packets of data to the PC every 1ms.
Full speed USB can send up to about 1MB per second, I don't know how much it is in practice. In the fastest delivery there is no check for errors and it is recommended for applications like audio.
Using USB requires designing your driver for the PC. If you use HID class USB then your PC already has a driver but HID USB is limited to max 64KB/s , not enough for you. Communication class USB or Mass Storage class may give you the speed you need but you need a driver for the PC. I have experience with HID class only and I find if slower than serial RS232.

Doesn't Microchip already have drivers for CDC USB device for Windows? I think that it has.. With RS232 what's the maximum speed i can catch..?
 

Vbase

Full Member level 6
Full Member level 6
Joined
Apr 7, 2015
Messages
373
Helped
75
Reputation
150
Reaction score
75
Trophy points
28
Activity points
2,036
The Microchip driver is for CDC USB to serial converter, it simulates a COM Port in your PC, I don't know of any other driver. That driver wont be useful for you.
The max speed of COM Port in a PC is about 10KB/s. The max speed I managed to get with USB HID is 8KB/s.
Transferring 256KB/s is something I don't have experience with so I can't advise you how to achieve it.
If you are sampling audio with your ADC then look at Microchip examples of audio USB.
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
The Microchip driver is for CDC USB to serial converter, it simulates a COM Port in your PC, I don't know of any other driver. That driver wont be useful for you.
The max speed of COM Port in a PC is about 10KB/s. The max speed I managed to get with USB HID is 8KB/s.
Transferring 256KB/s is something I don't have experience with so I can't advise you how to achieve it.
If you are sampling audio with your ADC then look at Microchip examples of audio USB.

usb full speed can't transfer 1Mbyte/s ..?
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
So with what type of communication can i achieve this speeds..?
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
I took dsPIC33EV256GM102 from a friend, but it don't have USB module. Can i send the data i need through serial port @ 70 MIPS? One thought is to buffer the data from adc to an SD Card (for big capacity) and then transfer it to PC. what do you think..?
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
I am thinking of use FTDI products, have anyone experience with them..?
 

KlausST

Super Moderator
Staff member
Advanced Member level 7
Joined
Apr 17, 2014
Messages
23,490
Helped
4,757
Reputation
9,535
Reaction score
5,170
Trophy points
1,393
Activity points
155,796
Hi,

FT2232H is high speed USB. With a simple PLD you could manage to transfer the data directely from ADC to FTDI. Afaik it has 4kBytes FIFO inside.
Try 245 parallel mode.

Then the ucontroller is free from processing load.

Klaus
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
Hi,

FT2232H is high speed USB. With a simple PLD you could manage to transfer the data directely from ADC to FTDI. Afaik it has 4kBytes FIFO inside.
Try 245 parallel mode.

Then the ucontroller is free from processing load.

Klaus

Thank for your answer. Have you used it..? What speed did you achieved..?
 

KlausST

Super Moderator
Staff member
Advanced Member level 7
Joined
Apr 17, 2014
Messages
23,490
Helped
4,757
Reputation
9,535
Reaction score
5,170
Trophy points
1,393
Activity points
155,796
Hi,

i already did a 300kbyte/s with a FT245RL (full speed type)

currently we are testing on a FT2232H (high speed)
one channel is for microcontroller communication, it does not need that high speed. The other channel is for SRAM->FPGA->USB->PC high speed data transfer. We did not test speed yet. But datasheet says 10MBytes/s.

from ftdi.com:
USB to parallel FIFO transfer data rate up to 10Mbyte/sec.
Single channel synchronous FIFO mode for transfers up to 40 Mbytes/sec.

I hope we can test it next week.

Klaus
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
300kbyte/s is very impressive. Have you faced errors or wrong data in the communication..??
I'll be pleased if you can inform me about the next week's test of FT2232H
 

KlausST

Super Moderator
Staff member
Advanced Member level 7
Joined
Apr 17, 2014
Messages
23,490
Helped
4,757
Reputation
9,535
Reaction score
5,170
Trophy points
1,393
Activity points
155,796
Hi,

Code:
Have you faced errors or wrong data in the communication..??
Never. I think the USB prtocol, or maybe the ftdi driver has some built in error detection. But i don't k ow.

The 300kBytes/s were with dd2 drivers and VB6 at the PC side.

Klaus
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
I'll try it for 300kbyte/s. I'll use dd2 drivers with C#.net
 

KlausST

Super Moderator
Staff member
Advanced Member level 7
Joined
Apr 17, 2014
Messages
23,490
Helped
4,757
Reputation
9,535
Reaction score
5,170
Trophy points
1,393
Activity points
155,796
Hi,

although i got 300kBytes/s i don´t recommend it in your application, because any other traffic on the USB may decrease throughput.
I recommend to use a high speed device instead.

Klaus
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
I am thinking of order the C232HM-EDHSL-0 ready cable based on FT232H. Isn't a good choice..?
 

VirusX2

Member level 4
Member level 4
Joined
Nov 18, 2014
Messages
74
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
544
OK so i have an A/D with parallel output (8-bit). Can i connect the A/D's output (D0-D7) directly to the FT245R FIFO (D0-D7) and handle only the control signals (WR or RD) from my PIC? That saves me microcontroller pins. Or i must connect the A/D's output to a PORT on my PIC and from another PORT send the data to the FT245R..?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top