EmbeddedRelated.com
Forums

Non-standard LPC1768 QEI peripherial use

Started by Yuri Ostry February 2, 2013
Hello,

I'm planning to use LPC1768 for a project that involves processing of some
not very common input signals and would like to ask people who are
familiar with LPC1768 and its Quadrature Encoder Interface peripherial
before making prototype board.

I have to support a custom controller (pedal) with current loop interface that
gives constant 20 ma once pedal is connected, wiring is correct, and
operator does not place their feet on it. Once a feet is placed on
pedal, it start to produce pulses (approx 50% duty cycle) at approx.
100 Hz. Frequency is increases proportionally while pedal is depressed
further, and while it is depressed completely, pulses freq. is about 2 kHz.

So, I have to monitor 3 possible states:

- Logical "0" at pin - controller is not connected of wiring is
damaged.

- Logical "1" at pin - controller is connected. Idle state.

- Negative going pulses at pin - operational mode. I need to measure
frequency and convert it to pedal depression state.

Looks like QEI peripherial have everything to do most of this task
without putting much overhead to CPU, but I was unable to find any
information about possibility ro read state of pin that is configured
as QEI clock input via GPIO registers (need to do this to check for
disconnected controller).

Does anyone tried to do something similar? I do not have hardware
on hands right now to test it.

And another question - if it will work, should I consider it as
"undocumented feature" that may suddenly stop working once NXP will
release new revision of silicon?

--
Sincerely,
Yuri mailto:y...@ostry.ru

An Engineer's Guide to the LPC2100 Series

If all else fails, you could connect the clock pin to a second input, and
read it as a GPIO.

Mike
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
Yuri Ostry
Sent: Saturday, February 02, 2013 8:17 PM
To: l...
Subject: [lpc2000] Non-standard LPC1768 QEI peripherial use
Hello,

I'm planning to use LPC1768 for a project that involves processing of some
not very common input signals and would like to ask people who are
familiar with LPC1768 and its Quadrature Encoder Interface peripherial
before making prototype board.

I have to support a custom controller (pedal) with current loop interface
that
gives constant 20 ma once pedal is connected, wiring is correct, and
operator does not place their feet on it. Once a feet is placed on
pedal, it start to produce pulses (approx 50% duty cycle) at approx.
100 Hz. Frequency is increases proportionally while pedal is depressed
further, and while it is depressed completely, pulses freq. is about 2 kHz.

So, I have to monitor 3 possible states:

- Logical "0" at pin - controller is not connected of wiring is
damaged.

- Logical "1" at pin - controller is connected. Idle state.

- Negative going pulses at pin - operational mode. I need to measure
frequency and convert it to pedal depression state.

Looks like QEI peripherial have everything to do most of this task
without putting much overhead to CPU, but I was unable to find any
information about possibility ro read state of pin that is configured
as QEI clock input via GPIO registers (need to do this to check for
disconnected controller).

Does anyone tried to do something similar? I do not have hardware
on hands right now to test it.

And another question - if it will work, should I consider it as
"undocumented feature" that may suddenly stop working once NXP will
release new revision of silicon?

--
Sincerely,
Yuri mailto:y...@ostry.ru

Il 03/02/2013 04:17, Yuri Ostry ha scritto:
> Hello,
>
> I'm planning to use LPC1768 for a project that involves processing of some
> not very common input signals and would like to ask people who are
> familiar with LPC1768 and its Quadrature Encoder Interface peripherial
> before making prototype board.
>
> I have to support a custom controller (pedal) with current loop interface that
> gives constant 20 ma once pedal is connected, wiring is correct, and
> operator does not place their feet on it. Once a feet is placed on
> pedal, it start to produce pulses (approx 50% duty cycle) at approx.
> 100 Hz. Frequency is increases proportionally while pedal is depressed
> further, and while it is depressed completely, pulses freq. is about 2 kHz.
>
> So, I have to monitor 3 possible states:
>
> - Logical "0" at pin - controller is not connected of wiring is
> damaged.
>
> - Logical "1" at pin - controller is connected. Idle state.
>
> - Negative going pulses at pin - operational mode. I need to measure
> frequency and convert it to pedal depression state.
>
> Looks like QEI peripherial have everything to do most of this task
> without putting much overhead to CPU, but I was unable to find any
> information about possibility ro read state of pin that is configured
> as QEI clock input via GPIO registers (need to do this to check for
> disconnected controller).
>
> Does anyone tried to do something similar? I do not have hardware
> on hands right now to test it.
>
> And another question - if it will work, should I consider it as
> "undocumented feature" that may suddenly stop working once NXP will
> release new revision of silicon?
>
I think your idea is to use QEI in clk and direction configuration and
this could work if you give it also the correct direction signal.
I don't understand so much your problem but if you can deal with the
data output given by QEI you could use it.
I mean that QEI needs a pulse train to give you output data, no pulse
train no data.

Personally I should prefere one of these solutions:
1. add an interface circuits to convert frequency to voltage
2. using a timer input capture to measure the pulse period or the frequency


Hello,

Sunday, February 3, 2013, 16:08:15, M. Manca wrote:
I think your idea is to use QEI in clk and direction configuration and
this could work if you give it also the correct direction signal.
I currently assume that if direction input is set as GPIO, input of QEI block is disconnected from pin and internally set to some constant value (no difference, will it "forward" or "reverse" - I need only velocity data from QEI anyway).

Another QEI feature that seems useful for my application - low rotation speed interrupt, that will be activated if operator suddenly release pedal or wiring is damaged during operation.

Both can be implemented without using QEI, but QEI may be able to do all this in hardware, without loading processor with thousands of interrupts every second.

I already thinked about using second GPIO to read state of signal that is feed to QEI clock input but there is no spare GPIO after I assigned all other signals to GPIO pins of chip. So, question about possibility to read QEI clock pin as GPIO is important for me (I can see 0 Hz in two cases - no feet on pedal or wire to controller is broken, I need to know input state to determine it).

Already ordered simple LPC1768 dev. board from one of eBay sellers, but didn't received it yet. Just pray to see revision "A" silicon on it, once it arrive, because initial revision of LPC1768 had non-functional motor control input pins.

--
Best regards,
Yuri mailto:y...@ostry.ru