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 support@ccsinfo.com

A/D 12 bit 1MSPS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Beginner
Guest







A/D 12 bit 1MSPS
PostPosted: Fri Jan 28, 2005 4:17 pm     Reply with quote

Please tell me how fast can I use AD7451 with PIC?
AD7451 - A/D 1MSPS with SPI interface.

and then put data from a/d to parallel port D

maybe simple code?
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

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

PostPosted: Fri Jan 28, 2005 5:17 pm     Reply with quote

You might be able to sustain 1MSPS but I have my doubts about there being enough instruction cycles to keep a 12MHz SPI stream running and shove data around inside the PIC too. Also, keep in mind that PORT-D is only 8 bits wide. Are you planning to only send out the upper 8 bits or are you going to be sending 8+4 as two seperate writes to the port.

Are you going to need to supply hand-shaking signals to whatever is receiving the data?
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Beginner
Guest







PostPosted: Fri Jan 28, 2005 5:54 pm     Reply with quote

Ok at first a must recieve that from SPI register ; A/D have 3 pin :

CS -
SCLK -
DATAOUT -

I must connect them to PIC through galvanic uncoupling I use adum1402.
And put 2.5V ref. to A/D (q. Can I Use 4.096V ref ?)

how recieve that 12bit data to some variable. small , simple source

After that, I think send data to PORTD as 8+4bit.
Beginner
Guest







PostPosted: Fri Jan 28, 2005 5:57 pm     Reply with quote

Why through PIC - because I need also display it on LCD!
Beginner
Guest







PostPosted: Fri Jan 28, 2005 6:00 pm     Reply with quote

If I can't recieve and send data 1MSPS - how faster I can do it? (MSPS)
with PIC working at 10MIPS.
Ttelmah
Guest







PostPosted: Sat Jan 29, 2005 3:26 am     Reply with quote

To read the data, you will have to drop the select line (one machine instruction), and then read two bytes from the chip (it returns the twelve bits left justified as part of a 16bit transfer). The SPI port transfers at a maximum of Fosc/4, so the transfer will then need 1uSec to complete. Then the CS line has to be raised (another instruction cycle). At this point you want to output the data. Presumably, output 8bits on portD, then strobe a chip select, then repeat this for the other 8bits. This is a total of about 6 instruction times. Potentially you could interleave the two operations, reading the first byte from the ADC, and strobing this out on port D, while you read the second byte from the ADC. Doing this, I'd say you could strobe data out into a parallel latch at a rate of perhaps 750K samples per second _assuming the PIC is doing nothing else_. However you then talk about an LCD. An LCD, will require a huge amount of processing time, and itself will have a huge time delay involved in accepting data. You'd be lucky to achieve even 10Ksps, talking directly to an LCD. On units that display data from a source like this, the approach is completely different. You have a block of 'dual port' memory, and all the sampling processor has to do, is clock the incoming data, and write this to the memory. The memory may even have an automatically advancing address counter, so that the processor doesn't even have to write the address. The display processor, then takes data from this memory, at a much slower rate, and writes this to the LCD. For even faster rates, the act of clocking the SPI, and writing to the memory, can be done without a processor at all, using a state machine, in a FPGA, and using this approach data can be transferred to the memory at the full 1Msps.
What you describe, is not really achievable using just a PIC. You need at least some dual port memory, and preferably a significant amount of support logic, to handle the high speed transfers. The PIC can then oversee this process, starting and stopping the transfer, and possibly writing the data to a display.

Best Wishes
Beginner
Guest







PostPosted: Sat Jan 29, 2005 5:27 am     Reply with quote

Thanks a lot!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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