Il 30/05/2013 00:08, rickman ha scritto:
> On 5/29/2013 2:30 AM, pozz wrote:
>> Why not sharing this "hardware" with the newsgroup? :-)
>
> Just open your eyes, it is easy to find using something called "Google".
> It was an RC timing value, a FF and an XOR gate, IIRC. This was my
> first job in electronics some 40 years ago, so I don't have the schematics.
Ah, ok, I got it now.
>>> I'm
>>> not sure which protocol you are working with, bi-phase or Manchester,
>>> they are slightly different.
>>
>> Manchester.
>
> That's the one where the polarity of the encoded signal after the
> "important" transition" is the value of the bit. The timeout value
> inhibits the unimportant edge when present and the direction of the
> important edge is used to set the value of the bit and timing of the bit
> cell. Then the timeout starts again. Normally an initial sequence
> which produces just one transition per bit is set to allow the circuit
> to synchronize. I think the EM4100 protocol starts with a degenerate
> case of two transitions per bit with "111111..." as the start.
Yes, a sequence of 9 ones. This sequence appears just one time in the
code, because of even parity used in next data field.
On that page Biphase *and* Manchester modulations are described for
EM4100 tags. Why are you thinking my tags can't use Manchester? Even
if I assume Biphase modulation, the big jitter can't be simply explained.
> The Biphase signal will produce one pulse per bit for a "11111" sequence
> and assure proper sync from the start. I would think this would be
> important for RF signals where a little noise at the start will corrupt
> the entire signal. But I suppose they deal with that by repetition and
> checksums, eh?
Yes, you're right. The 64-bits code stored in the tag is continuously
transmitted while there's RF power from the reader.
>>> One works with the level and the other
>>> adds a transition for one state and omits the transition for the other
>>> state. You just need one timing value to discriminate between the long
>>> timing and the short...
>>
>> Yes, this in theory. Indeed I started working with this simple logic,
>> but it never worked.
>
> Then something else is wrong. The encoding/decoding *is* that simple,
> but if the signal is not right, you can't expect to decode it. Did you
> ever figure out why you get a 2/3 width pulse? That will foul up every
> time... or maybe 50%, lol.
I don't know why this happens. Actually I think this behaviour is
intrinsic in my RF complete system: maybe it depends on the circuit
(identical to one of application circuits described in the datasheet of
U2270B) or on the U2270B or on the low-quality tag. The thing that is
sure is the great jitter I see on the scope at the output pin of the
U2270B when the tag is in proximity.
>>> but then we didn't have the third pulse width
>>> you are seeing.
>>
>> I don't see just a third pulse width, I see that short and long widths
>> are too much variable. The maximum short pulse width is very similar to
>> the minimum long pulse width!
>
> That will be very hard to deal with. The idea is that you use timing to
> discriminate the edge you want to ignore and just use the edge with the
> information. Do the timing values vary slowly over time or will one
> message have pulse widths all over the map? If it varies slowly, you
> can use some sort of PLL or similar to vary your timeout value. But if
> it varies fast from one bit to the next, I don't know of a way to deal
> with that.
Unfortunately, the second you said. I solved relaxing the timing
thresholds. The waiting time for the next "important edge" is 340us and
not the theoric value of 256us.
If I use 256us, I risk to detect "unimportant edges" as important ones.
>>> Once you are sync'd with the correct edge, you use the
>>> timing value to tell you if the next edge is the short or long and in
>>> one protocol ignore short edges, in the other use the presence of the
>>> short edge to set the bit value. Having a third pulse width means
>>> something is wrong.
>>
>> How did you decode the RF signal? I'm using U2270B from Temic (actually
>> Atmel), maybe this is the problem. Indeed take a look at what I found in
>> its datasheet:
>
> How is the RF modulated? Is it something you can see on a scope? First
> make sure the RF signal is right. I'm guessing it is amplitude
> modulated. Can you try viewing the signal at the "input" pin? Check
> the pulse timings there so see if the RFID tag is sending what you expect.
I'll try to analyze RF signal, until now I checked the demodulated
signal at the output of U2270B. Anyway it's very difficult to
understand if the signal is the one I would expect: the code is 64bits
and is impossible to synchronize the start of the code on the scope.
>> Figure 9 shows the timing of the Manchester and bi-phase code in an
>> ideal situation. However, the timing of the code at the decoder input is
>> affected by various effects of modulation, demodulation and noise in
>> most applications. THERE IS A JITTER AT THE RISING AND FALLING EDGE OF
>> THE DATA SIGNAL. ADDITIONALLY, THE CLOCKS OF THE TRANSPONDER SIGNAL AND
>> THE DECODER SYSTEM ARE ASYNCHRONOUS. The decoder should evaluate the
>> reader output signal with the method shown in figure 10 to achieve a
>> maximum range and minimum errors.
>> ---
>>
>> The method described in Figure 10 is similar to the algorithm I have
>> described. It seems the jitter I measured is normal.
>
> If the short pulse timing is as long as the long pulse timing,
Sometimes yes.
> it is
> *not* normal and likely can not be decoded by any means unless the
> variation is slow and can be compensated by tracking your timing with
> it.
> [...]
>
> Looking at figure 10, you don't need to detect short pulses in
> Manchester, they are just ignored, so you don't need to use the two
> timing parameters for short pulses.
The short pulse minimum and maximum widths (Ts1 and Ts2) are used in the
algorithm suggested in two cases.
During the first phase when we are searching for a long pulse: if the
detected pulse could be considered short, the search can continue,
otherwise if it could be considered long the search is finished,
otherwise it is an error.
During the second phase, if the edge is not detected before Ts2 from the
last "important edge", it is an error. I think this check could be
skipped. It's there to understand immediately if something is wrong
with the decoding.
> There is no advantage for detecting
> the long timing value of the long pulse, what do you do if it doesn't
> come by that value?
The first step is important to search for the "important edge". And any
"important edge" is exactly at the end of a long pulse. If this long
pulse doesn't appear for a certain time, it's an error (tag is not
present?).
> So you are left with one timing value. Anything
> before that value is ignored, anything after is a data transition.
>
> If you see the signal is not possible to decode because of timing
> variations, then no circuit can decode it reliably. So just how bad are
> your timing variations? Can you use the parity bits and have multiple
> reads to find one or two or three that pass parity and all agree?
Yes, I use parity bits for rows and columns and they are correct. So
I'm confident my decoding algorithm is working well. The only problem
is that the edges are very "jittered" and sometime the code can't be
decoded: the parity bits aren't correct or I see some "important edges"
too early since the last "important edges".
Thank you for loosing time with me...