Shop OBEX P1 Docs P2 Docs Learn Events
Help: I/O in real life — Parallax Forums

Help: I/O in real life

Luis DigitalLuis Digital Posts: 371
edited 2008-09-03 13:51 in Propeller 1
Hello all,

I am trying to use the Propeller as tool, but I have found problems, for example:

- Frequency meter: I want to protect the input to read frequencies that have more than 5 volts and I have tested several configurations (circuits), but always the Propeller reads a higher frequency.

I have tested circuits of entrance as this:
http://www.qsl.net/yo5ofh/pic/digiscale.htm

9 Hz Propeller read 260 Hz for example.

Removing the capacitor of entrance (22n) functions better, but upon reading 110 volts AC, reads 64 Hz.

Someone used a multimeter Fluke and he reads exact 60 Hz and my Propeller has remained in shame. sad.gif

Is the Propeller very sensitive or has the circuit of entrance a serious error?

Comments

  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-09-02 22:04
    Do you have any code you can post so that we can analyze this? When you say the propeller reads a "higher frequency" than it should, the first thing that comes to mind is jitter. You may to use a better circuit. Basically, if you are trying to read a 60hz AC signal, there may be a bit of noise on the line. When the signal crosses the high/low threshold, any bit of noise can cause 2 counts, instead of one. Do you have any sort of hysteresis in your circuit to prevent this?
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-02 22:13
    Luis, are you using the counters in ADC mode ore are you using a chopper to provide a digital representation?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Luis DigitalLuis Digital Posts: 371
    edited 2008-09-02 22:24
    Software: I am using code from example FrequencyCount.spin (AN001-PropellerCountersv1.1).
    Hardware: I have tested several configurations, but basically the circuit shown up.

    If use the Pin directly there is not problem, I can read even other oscillators of 5 MHz for example and measures exact. Also I can generate different frequencies with another Pin and to take the exact reading, but when use the circuit for protection the frequency shown is higher.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-02 22:32
    Is there anyway you can post a schematic of the setups you've tried? Something to note is that the Counters run as ADC are not very accurate or repeatable, good for getting rough estimates, but not very good for precision work. If you are only interested in the frequency, I would recommend using some form of zero-crossing detector, then average several pulses to obtain a measurement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-02 22:45
    I notice that the circuit you're using normally feeds into a PIC with a clock frequency of 10MHz.· As I recall, this is divided down to make the system clock so the PIC can't respond to frequencies much over 2.5MHz.· The Propeller normally has a system clock of 80MHz and the counters can respond in edge trigger mode at at least 40MHz.· The input circuit you showed is broadband and could be producing noise that's throwing off your counts.· Have you looked at the waveform with a 'scope?
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-09-02 23:40
    hello Luis,

    what's the maximum frequency that you want to measure ?

    If this frequency is not too high why not using a comparator with hysteresis ?

    or even just an optocoupler to protect the propeller ?

    do you need a big voltagerange ?

    best regards

    Stefan
  • Luis DigitalLuis Digital Posts: 371
    edited 2008-09-03 00:39
    I do not have Frequency meter neither oscilloscope to see that is passing.

    The idea is to create all these tools with aid of the Propeller.

    I have thought to do later an oscilloscope using this converter.

    The "X" signifies that I have tested of the two forms and also other configurations.

    In spite of the fact that the transistor is of highly frequency (NTE 123) to 15 MHz does not want to work.

    Perhaps I have been very ambitious:
    0 Hz - 40 MHz
    2V - 110V

    For a so simple circuit.

    Finally I think to use two diodes and a resistance, seems me that can be sufficient insurance for 30 volts and thus I maintain the complete frequency range.

    But if you have a configuration that work would adopt it.

    When it finish the project I will take some photos to show it here.
    345 x 223 - 6K
  • rjo_rjo_ Posts: 1,825
    edited 2008-09-03 04:04
    Luiz,

    Do you have an extra diode on the signal line to keep the signal from bouncing back? Are you shielding your signal line?

    Rich
  • Luis DigitalLuis Digital Posts: 371
    edited 2008-09-03 13:51
    rjo_ said...
    Luiz,

    Do you have an extra diode on the signal line to keep the signal from bouncing back? Are you shielding your signal line?

    Rich

    - In an occasion I tested using a diode in series in the entrance.
    You refer to use it in the collector of the transistor? I am going to test and if works I will put a message.

    - A little, but me does not seem that that be the problem and much less when is a matter of low frequencies.
Sign In or Register to comment.