How fast microcontroller can read the input signal

Thread Starter

champ1

Joined Jun 4, 2018
136
hi champ,
Your question is poorly defined.;)
Which type of input signal and what do you mean by 'read'.?
E
And what kind of microcontroller is it?
PIC controller like PIC16f877, PIC16f877a

My doubt is if the 40MHz digital signal applied to the input pin of the microcontroller.

Does microcontroller can read the state of input signal if microcontroller running with 20Mhz crystal
 

ericgibbs

Joined Jan 29, 2010
18,766
hi,
In a PIC the crystal frequency is divided by 4, so a PIC with a 20MHz xtal is working at 5MHz.
So it cannot follow and read a 40MHz continuous input signal.
E

What is your application.?
 

LesJones

Joined Jan 8, 2017
4,174
For the PIC one instruction cycle time is 4 cycles of the crystal frequency. So one instruction cycle is 200 nS. So just to read a port into the W register will take 200 nS One bit of a 40 Mhz data stream is only 25 nS. Just getting a bit of data into one bit of the W register is only the first step in the process. You then have to do something with the data. (Maybe assemble 8 bits into a byte.) The only exception may be the Master Synchronous Serial Port when used with SPI data. You would need to study the data sheet to find the maximum speed for SPI data.

Les.
 

Thread Starter

champ1

Joined Jun 4, 2018
136
hi,
In a PIC the crystal frequency is divided by 4, so a PIC with a 20MHz xtal is working at 5MHz.
So it cannot follow and read a 40MHz continuous input signal.
E

What is your application.?
I had doubt only so I asked

My other doubt , Can I replace 20MHz crystal with 40MHz crystal ?

Will PIC16f877 run with 40Mhz crystal ?
 

LesJones

Joined Jan 8, 2017
4,174
No. Read the data sheet. It may help is you answer Eric's question in post #5. If we knew what you are trying to do we may be able to suggest a solution rather than just reading information from the data sheet for you.

Les.
 

atferrari

Joined Jan 6, 2004
4,764
You now ask for that specific micro but the next time you could resort to a different one that has PLL so with the same crystal it could run much faster. Keep that in mind. Typical of the 18F family.
 
Top