cancel
Showing results for 
Search instead for 
Did you mean: 

programming the control register (st7538)

thorsten-kopp
Associate II
Posted on September 23, 2005 at 06:01

programming the control register (st7538)

37 REPLIES 37
thorsten-kopp
Associate II
Posted on January 18, 2005 at 10:11

I have changed the sensitivity mode (from 0 to 1) and now the

synchronization is correct but the received bits are wrong.

Sometimes there are 9 clock bits, sometimes 8 ???

The received bit design is not always the same!

krapf
Associate II
Posted on January 18, 2005 at 10:48

Quote:

On 18-01-2005 at 14:41, chiptuner wrote:

I have changed the sensitivity mode (from 0 to 1) and now the

synchronization is correct but the received bits are wrong.

Sometimes there are 9 clock bits, sometimes 8 ???

The received bit design is not always the same!

You found something I can´t describe as a BUG or as a FEATURE, but. The time the ST7538 takes to detect the carrier is the same time it takes to detect that the carrier is gone!

This leads to something like receive 9 bits for 8 bits sent, because after the 8th bit sent, the sender stop producing the carrier. But this is not instantly.

Because of unknown reasons the receiver can recover 9 bits, or 10, or 11... :o

What I do is send message as blocks, because the extra bits are always in the end of the last byte of the message block. So, I have range of valid number of bytes for valid message blocks. This validation refuses the extra undesired bits received. :-]

Did it help?

boicuflorin
Associate II
Posted on January 18, 2005 at 16:40

Hi,

I have the same problem. I made an experiment:

St7538 at 132.5kHz, 2400 baud, Carrier detection

with conditioning, synchronous. I tried to receive

only one byte. So I have the clock CLRT only when I

received the byte. I recognise the byte by reading the RXD

line on rising edge but at first i verified if the CD/PD = 0

(this is usefull at other mode like carrier detection without

conditioning when I have clock CLRT all the time).

What I see on the oscilloscop:

Sometime I have 9 clock, sometimes 10 clock. When I have 9

clock: first 8 is data (on the rising edge) and the last is unusefull. When I have 10 clock, first is unusefull, then 8 is data, and the last is bad. One more problem: In both case at the last clock

(what is bad) sometimes I have CD/PD = 0 and sometimes = 1.

I think (not sure) this is from detection time because when I modified this time the CD/PD is not the same and I receive

the data clock but with CD/PD = 1. The problem is the same for N

byte. I receive: N*8+1 or N*8+2 clock CLRT (with the last one on rising edge sometimes with CD/PD = 0 or 1). Tomorrow I hope

to make other test! 😉

krapf
Associate II
Posted on January 18, 2005 at 16:46

I am always verifying CD/PD!

I never read a bit if CD/PD = 1

:-] :-]

Rafael Krapf

BRASIL

thorsten-kopp
Associate II
Posted on January 19, 2005 at 04:18

Thank you for your tip, but my problem is that I don't know when the first bit of my message appears. Sometimes it is catched at the second edge, sometimes the first two clocks are my first bit, so I can't say that the invalidly bits are always at the end!

boicuflorin
Associate II
Posted on January 19, 2005 at 04:36

Hi,

One possible method:

Start a timer at the falling edge CD/PD 1->0.

If you receive the first clock with the timer stoped or the time Tb/2 then this is correct bit and the next 7 bit is correct.

boicuflorin
Associate II
Posted on January 19, 2005 at 04:52

Hi,

Maybe TB/2 is not the correct time :-Y

krapf
Associate II
Posted on January 19, 2005 at 08:50

Hi guys,

Really, the carrier detection or preamble detection of ST7538 is very poor in quality.

This means that I actually NEVER have sure about WHEN is the first bit. :-Y .

How, then, did I managed to find my message in the received bits?

:-Z I made my own preamble detection in software! 🙂 :D 😉

I send a fixed FIRST byte for every message.

Every received bit is SHIFTED IN to a byte variable, when the byte variable is equal to the fixed first byte of the message, then every bit following this byte is a valid message!

Hey guys, don´t forget: You have the power of software at you hands. anything can be made with this power!!! :-] :-] :-]

Rafael Krapf

BRASIL

boicuflorin
Associate II
Posted on January 19, 2005 at 10:22

Hi Rafael,

can you tell me what detection method you used?

(also baud, frequency...)

Thank's

krapf
Associate II
Posted on January 19, 2005 at 10:30

Quote:

On 19-01-2005 at 14:52, flo123 wrote:

Hi Rafael,

can you tell me what detection method you used?

(also baud, frequency...)

Thank's

Of course!

I am still changing somethings, as I am in the search for better communication setup, but the system today is working with:

BAUD: 1200

FREQUENCY: 76 kHz, 82.05 kHz and 86 kHz (changed on the fly)

FREQUENCY DETECTION TIME: 500 usec

DETECTION METHOD: Preamble detection without conditioning

INTERFACE: synchronous

SENSITIVITY: High sensitivity

INPUT FILTER: Enabled

Rafael Krapf

BRASIL