- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am attempting to complete a PSoC1 project involving using a 555timer circuit as a capacitance meter. Essentially the resistor/capacitor network in the circuit directly relates to the 555timer output in that t = 1.1RC. I am fine with the circuit design, my problem is in writing the main.c file for it. I need to be able to read in the 555 output, have PSoC recognize the T value, and calculate for capacitance and display it to the LCD. Any help would be greatly appreciated.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Measuring a time in PSoC1 is performed in different ways depending on the frequency of the signal:
When the frequency is high you count the number of pulses within a given time, which you generate with a separate timer or useing one of the VCs,
At lower frequencies you can use a counter that counts the pulses of a fixed frequency and which is enabled by the signal to measure.
At the end of the measure-cycle an interrupt is generated the value is read-out and the next cycle is set up.
For further information have a look into this application Note AN2283 www.cypress.com/
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some useful reference material, attached.
Some questions -
1) Range you want of T / F measurement ?
2) Resolution of the measurment ?
3) Accuracy of the measurment ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like counting the number of pulses in a given time frame would be the best solution. I essentially now need to write a main.c file to see the square wave, count how many pulses in a given time, divide the number of pulses by time to obtain T value, have PSoC calculate C from equation T = 1.1RC, and display the result on the LCD.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using PSoC. why do you need the 555?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would you suggest ommitting the 555?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some questions -
1) Range of C values to be measured ?
2) Accuracy of measurement ?
3) Do you need ESR value as well for the C ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no real definative answer to those questions. The better the range and accuracy the better, but there is no real set guideline as to range and accuracy. This is really supposed to be a first step into PSoC. I only have a very basic knowledge of the material.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should define what is the goal of your project first. Then design the solution to meet your goal. Otherwise it is hard to give you proper suggestion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there an AN2283 application available that has more comments in the code? The only one I could find had very minimal comments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not that I am aware of, however if there is a section of code you
need help on, eg functionality/explanation, forum can assist you.
Regards, Dana.