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

PIC24EP maximum sampling speed per input

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



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PIC24EP maximum sampling speed per input
PostPosted: Mon Sep 18, 2023 12:15 pm     Reply with quote

Device: PIC24EP512GP806
Compiler: 5.026

Hi guys,

My device is running with an internal frequency of 129.048MHz (external oscillator is 29.4912Mhz.

I don't currently have the proper setup to test at the moment but I know someone will have an answer....

Let's say I have an input with a square wave and I want to sample on every L-to-H (not by interrupt), what can be the maximum frequency that this square wave can have? 100Hz? 1MHz? 10MHz?

Thanks,

Ben
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Wed Sep 20, 2023 11:03 am     Reply with quote

Depends totally on what else the code is doing. No simple answer.
If it is simply sitting in a loop waiting for the edge to go high, then if using
standard I/O, you would have about 6 instruction times in the loop, so at
your 64MIPS, you could detect an edge at about 10MHz, but the speed that
things can be done, then depends on what happens when this detection
happens.
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Wed Sep 20, 2023 11:24 am     Reply with quote

Alrighty. For sure it would be doing way more than sampling but I guess what I wanted to try definitely won't work.

Just wanted to see if there was a way to use this with an OV2640 camera (not just the chip but the entire camera with a 24-pin FPC flat ribbon connector).

I think 10 MHz is the bit clock per frame.

Thanks!

Ben
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Thu Sep 21, 2023 1:31 am     Reply with quote

Problem is that in code terms, the act of writing the byte to a memory address,
and then incrementing that address takes more time.
Now some of the chips have DMA that can transfer a byte triggered by a
signal, so this might be able to read a line of data, but then you would run
out of size for the next line.
It is a key thing to understand fundamentally about the PIC, that they
always have relatively small RAM sizes. Even the DsPIC's are not suited
to handling things like video frames. You could relatively easily program
an FPGA to transfer bytes into a RAM memory on each clock, and then
have this RAM memory available on a PIC port to be worked with. However
doing something involving the whole frame would be much better suited
to a chip that can have this RAM inside it's fundamental memory map.
The Harvard architecture gains advantages by being able to fetch from
ROM and RAM at the same time, avoiding the need for the complexity of
cache RAM etc., but it has disadvantages when you want to have large
RAM areas mapped into the primary memory....
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