I remember one of my colleague did this example for some customer using PD5.1. Unfortunately, I won't be able to attach zip file over here. Can you please provide me your email address such that I can send it to you via email.
I have sent the example project to the above mentioned email. Please find the same.
At the most basic level you need a gate of known width in time,
and a counter that starts counting when gate is active (high),
from a known value (255 8 bit, 65535 16 bit), and stops counting
when gate goes low. You read the value of the counter, subtract
it from start value, and divide by gate period in seconds.
16 bit example, .1 sec gate period, f = (65535 – count value) / .1
To setup Gate
1) Timer, setup for .1 or 1 sec (resolution would be 10 Hz or 1 Hz
respectively). You set up period to be 2X desired gate period, and
compare value 1/2 period, so that high time of compare output =
gate period, low time = gate period.
2) Route timer compare out to counter enable.
To setup counter
1) Route pin, Fin, to counter clock
2) Route timer compare out to counter enable
1) Load counter with its max allowed value, 255 for 8 bit, 65535 for
2) Start counter
3) Enable timer ISR, on terminal count, that means gate is low, counter
not enabled to count
3) Start timer
When ISR occurs set a flag and return
1) If flag true read counter (gate is low so it is not enabling counter)
and compute frequency. Reload counter with its max value.
There are other optimizations that can be done, for example stop and reset
timer when ISR occurs so that gate low period is minimized, and measurement
frequency is increased.
If the frequencies you are measuring are very low, like less than 1 Hz,
use reciprocal counter technique.
Dana give some hints to do the project already. Try to come up with your project. post it here for others to help. But you have to do it yourself to learn.
sir, can i interface my light sensor tsl235 directly with CY8CKIT-001 DVK .Actually my work is to detect light intensity of different laser and measure its frequency and develop a device which is very sensitive. so i m using TSL235 converter for my work.i need to do it on PSoC designer. help send me demo sample and if possible code also.Thanks
TSL235 is a light sensor with frequency output. You can refer application note AN2283 - PSoC 1 - Measuring frequency
I would suggest to use a light sensor with analog output and then do signal processing inside PSoC. You will be able to reduce the system cost.
what if i m using tsl235. this AN code is perfect for my work
You can use AN2283 for measuring sensor output frequency. However, there is not much PSoC value in just measuring the frequency. If you are doing something else also with PSoC, then it is fine. The best thing would be, as I told earlier, to use a simple light sensor and implement analog processing chain along with calibration inside PSoC. This way, you will be able to use the device to its maximum capacity and also reduce the system cost.
that i m considering your point.
if i'll go with analog output sensor then can u please help out with system design and coding.
as i've mentioned my work above..
its simply to measure frequency by falling different color of light on tsl235
and check its frequency. also i've to show graph b/w wavelength and intensity for particular color of light in LABview
Ishu, we can help to resolve any specific issues which you will have during solution development and provide pointers to the already available materials.