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.

Configuring 18F ADC

Status
Not open for further replies.

engr_joni_ee

Advanced Member level 3
Advanced Member level 3
Joined
Nov 3, 2018
Messages
822
Helped
2
Reputation
4
Reaction score
7
Trophy points
18
Activity points
6,875
Hi,

I would like to have a signal channel 50 KSPS 12 bit ADC system. Is there any widely used suitable 18F device with some example codes.
 

Hi,

Nobody knows your requirements. Neither for hardware nor for software.
* 12 bits resolution ADC --> can be found using comparison charts
* 50 kSps --> depend on your clock frequency, nobody knows...

Also nobody knows:
* whether you want continous sampling, single samples, bulk sampling
* how much sampling jitter is allowed (determines what trigger method you need)
* whether you want to store the data (how many samples)
* or you want to process the data (what algorithm)
* what language you want the code
* what compiler, IDE ...

Klaus
 

I assume you mean a Microchip PIC18F family device. If so then look at https://www.microchip.com/maps/Microcontroller.aspx, make the appropriate selections and see what comes out.
As for sample code, look at the selected product data sheet in the configuration, IO, oscillator, and ADC sections. Whether you write in C or assembler, the code is virtually the same across all members of the PIC18F family of devices (you may need to handle device-specific variations etch as PPS, IO registers etc.) and there are LOTS of examples in this forum, on the Internet and in the Microchip forums.
Finally, there is MCC that will do some of the basic work for you.
Susan
 

Hi,

I would like to use PIC 18F. Here is some more info.

- Sampling - continuous 12 bit 50 Ksps
- Sampling jitters – minimum possible
- Data – store all samples
- Processing – just raw data to send with date and time stamp and packet number
- Language – C
- Compiler – MPLAB Compiler XC 8

I have some questions.
Is it ok to use PIC 18F for this application ? Which peripheral is suitable ? How about PIC18F25K50 or PIC18F45K50 ?
 

Hi,

"Continous sampling" and "store all samples" is impossible, because it means infinite ammount of memory.

Please explain.

Klaus
 

Hi,

I would like to transfer the sample data directly to PC through suitable peripheral. The acquisition time would be finite obviously that could last from 1 to 15 min. The sampling rate however I would like to have 50 Ksps with 12 bit precision.
 

I think it can be done but it would be tricky.
Look at the math: lets say 12-bits can be stored in two bytes.
50Ksps = 100,000 bytes per second
100,000 bytes per second = 6 Megabytes per minute.
15 minutes = 90 Megabytes.

Obviously, storage inside a PIC is out of the question. Your problem is coordinating the data flow and transferring it quickly enough. You need a fast ADC, fast software and a fast interface to the storage device. I doubt you could do it in real time to a PC using a PIC and presumably a USB interface.

Brian.
 

Hi,

If I remember right, then I've transferred data with an ATmega 8MHz with the data rate of 300kbytes/s via FTDI FT245.

Still unsolved problem: How to detect high byte and low byte?

Klaus
 

Hi,

I am wondering to include a packet counter of 12 bit with each 12 bit data sample. The packet counter will reset after reaching the highest value.

The new calculations is as follows.

24 bit / 8 = 3 byte to transfer for each data sample
50 Ksps means 50 x 3 = 150 k bytes / second

How about packet overhead for USB full speed ? Which transfer type I need to consider for continuous data transfer ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top