M XXWZT
M XXWZT
SUMMARY Page
I INTERFACE BETWEEN ST7537 AND ST626X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.I INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2 PINS DESCRIPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.1 RSTO and NMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.2 Carrier Detect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.3 Rx/Tx. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.4 Rxd and Txd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.5 Watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.6 Oscin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.7 Other ST6265 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.7.1 RESET Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.2.7.2 PA4..pA7 Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
I.3 SOFTWARE INITIALISATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
I.4 TIMER 1 FOR 1200BPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
I.5 INTERRUPT ROUTINES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
I.5.1 NMI interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
I.5.2 Receive Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
I.5.3 Timer 1 Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II TRANSMISSION METHOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II.1 MAIN ASPECT OF COMMUNICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II.1.1 Asynchronous 1200bps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II.1.2 Carrier Detect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II.1.3 Programs Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
II 2 PACKED MESSAGE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
II.3 C.S.M.A. PROTOCOL SPECIFICATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
II.4 REAL TIME AND COMMUNICATION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
II.5 FRAME DEFINITION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
II.5.1 Standard Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
II.5.2 Acknowledge Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
II.6 COMMUNICATION REGISTERS DEFINITION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
II.6.1 Communication Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
II.6.2 Network/Application Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
II.6.3 Parity Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
II.7 MAINS FLOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
II.7.1 Main Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
II.7.2 Reception Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
II.7.3 Acknowledge Control Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
AN535/1094 1/20
REMOTE CONTROL USING ST7537 AND ST6
PRELIMINARY
All benefits and features of the ST7537CFN have been detailed in Application Note AN655.
I suggest the reader to read this one before starting with this new application.
2/20
REMOTE CONTROL USING ST7537 AND ST6
I- INTERFACE BETWEEN ST7537 AND ST626x the receive program, even if the ST6 is doing
SGS-THOMSON is now introducing with this inter- something else. So the pin pA0 has to be pro-
face between the power line modem ST7537 and grammed as an interrupt (with pull-up) to allow
the low cost family ST6MCU a wide range of appli- receiving.
cations for home automation. This module allows I.2.3 - Rx/Tx
communication between distant equipment by the The Rx/Tx pin is used to switch between receive
mains and then remote control can be done in an and transmit mode. It has to be connected to an
easy way. This include applications like lighting output port of the ST6, to allow the ST6 to switch
dimmer, heater control, or phone remote system. between Rx and Tx. pC4 has to be programmed as
output port.
Figure 1 : Hardware Connection Between
ST7537 and ST6265 I.2.4 - Rxd and Txd
ST7537 ST6265 Digital datas are going over these pins. They have
C WD pA1 to be connected to pC2 and pC3 for the data
o Rx/Tx PC4 transfer. Then, the programmer can use the PSI
m
m CD pA0 (Programmable Serial Interface) or work on the
Mu
a n Txd pC3 data values by programming pC3 as output and
i i
n c
Rxd pC2 Reset
+
pC2 as input (without interrupt and with pull-up).
s a RSTO NMI
t I.2.5 - Watchdog
i MCLK %2 Oscin
o pA7...pA4
This pin is connected to pA1, which must have a
n falling edge at least every 1.5s (MAX value). This
feature has been included in ST7537 for security
F = 11.0592MHz reason. So pA1 has to be set and reset at least
every 1.5s (see RSTO pin description).
Address
AN535-01.AI
AN535-03.AI
D Q
(typically 7.6V) or when no negative transition oc-
curs on the watchdog input for more than 1.5s.
Then, the RSTO is going back to low level. This
falling edge is used to make an NMI on the ST6 A flip-flop D-type is used to divide MCLK by 2. So,
chip. The NMI vector (number 0) must be the same the microcontroller has an input frequency of
as the reset vector in order to comply with Home 5.5296MHz (quartz frequency divided by 2).
System specifications. I.2.7 - Other ST6265 Pins
I.2.7.1 - RESET Pin
Figure 2 : RSTO Generate a NMI
To provide a good initialisation, a 2.2µF capacitor
H is connected to the ST6265 reset pin. An internal
RSTO pin
300kΩ is loading the capacitor during the power on.
L
AN535-02.AI
The hexadecimal values are given only for exam- one is used for C.S.M.A. management (see II.3).
ple, these values will change due to the others pins Table 2 : Baudrate Variation
programming (application software). In the pro-
gram, every write to port A and port C must be done Min. Nom. Max. Unit
by writing a copy register, because these ports are Rate 1,199.96 1,200.08 1,200.2 Bps
in input and output, and this includes single bit
operation (see ST6265 datasheet for further de- That means the following registers values :
tails).
Table 3 : Timer 1 and Oscillator Configuration
I.4 - Timer 1 for 1200Bps
Register Bit Value
The MCU frequency is 5.5296MHz. With an inter-
nal clock divider set to 1, a prescaler set to 4 and Oscillator control register RS0 0
OSCR RS1 0
a counter set to 96, the transmit and receive rate is
1200.08Bps (Figure 4). Timer status control register PS0 0
TSCR1 PS1 1
The quartz is a 11.0592MHz with a accuracy of PS2 0
100ppm. That means a final variation of 0.12Bps Timer counter register D0 - D7 96
around 1200.08Bps. TCR1 (decimal
When the timer 1 is not used for the baudrate this value)
ST6265
TIMER/
FLIP-FLOP OSCILLATOR PRESCALER COUNTER
WATCHDOG
D TYPE DIVIDER
DIVIDER
AN535-04.EPS
4/20
REMOTE CONTROL USING ST7537 AND ST6
CD
Wrong bits
5/20
REMOTE CONTROL USING ST7537 AND ST6
AN535-06.AI
P : Parity Bit
SP : Stop Bit (high)
PARITY
PREAMBLE HEADER DATAS CHECK
Acknowledge Frame
PARITY
AN535-07.AI
FFh E9h 58h CHECK
1 byte
6/20
REMOTE CONTROL USING ST7537 AND ST6
7/20
REMOTE CONTROL USING ST7537 AND ST6
These 21 registers have a name, but more than 17 munication status by looking at the Network/Appli-
bytes are needed for communication. In fact, com- cation register.
munication program needs 43 registers (that in- The network/application register is used in two
c lu d e so f t wa re s t a c k a nd bu ff e r f o r ways :
communication). - Tointerface the application program with the com-
munication program. The application program is
II.6.2 - Network /Application Register able to know if order has been received or if an
Application program is not sequential because of acknowledge has been received,
the use of several interrupts. These interrupts are - To enable protocol control inside network pro-
used for reception and communication timing. The gram. That means byte error, unexpected frame,
main program is able to know what are the com- time-out, bad frame parity, transmit-enable.
Table 8 : NA_CTRL Definition
D0 D1 D2 D3 D4 D5 D6 D7
Byte error Unexpected Bad frame Time-out Transmit Too many frame order
frame parity enable errors acknowledge received
8/20
REMOTE CONTROL USING ST7537 AND ST6
- Pdatas : Parity of data byte II.7.1 - Main Flow (see Figure 11)
- Porder : Parity of order byte When the board send a frame, it is waiting for an
- Pda : Parity of destination address byte acknowledge, and tries 3 times if nothing is coming
- Psa : Parity of Source address byte for a delay. If an acknowledge arrives, it is checked
(parity check) and if a problem occurs, the MCU
- Pctrl : Parity of control byte
tries again (3 times maximum).The slave system
- Pha1 : Parity of first home address byte main flow is the same as the master system, but of
- Pha2 : Parity of second home address byte course, the application program changes.
Figure 11 : Main Program Organisation
11
1 Carrier
MAIN Detect
10
NMI
2 12
Init Receive
17
Application
Recovering
4 9
Yes 13
Order Send Ack
Received? Do Order Timer 1
IT
5 7 16
Waiting Yes Transmit/
Ack
Ack? Control Receive
Enable
8
AN535-08.AI
Application
9/20
REMOTE CONTROL USING ST7537 AND ST6
1
Receive it
2
Receive
Init
Next Char.
3
No Carrier Wait
Time Out Char.
Startbit
4 Good Char. 5
Receive Frame
Char. Built
Bad Char. All car.
Received
Unespected Good Frame
7 Frame
RETI 6
Modify
AN535-09.AI
Status
Order Done
II.7.2 - Reception Flow and a timer control. The parity byte is calculated as
The synchronisation is done on each startbit : it’s a the frame is sent, and it is sent after.
byte synchronisation. In order to leave MCU time for application, receive
IT is disabled after each frame reception and for a
II.7.3 - Acknowledge Control Flow delay of 30ms. This time is controlled by the Timer
The transmit part will not be detailed, it is just a pins 1 and the reg_delay register.
Figure 13 : Ack Control Routine
1
Ack
Control
2
Yes Acknowledge No
Received?
3
Compare No 4
Parity Check Time
Out
Yes
7
Retry
Send
AN535-10.EPS
Frame
5
Ret
10/20
REMOTE CONTROL USING ST7537 AND ST6
III - APPLICATION : DIMMER CONTROL you change the number on the display. This feature
has been added to prove that the ST6265 is able
III.1 - General Description (see Figure 14) to receive and send order while it is dimming.
This section gives an example of an application that If you plug the master system in first, it will try to
allows the dimming control of a remote light (or connect with the slave system three times, then it
something else) by using the transmission with will light the error led (digital point of the 7 segments
P.L.M. This application needs two boards : display). So you will have to plug the slave system
- A master system, with a push-button (Dim- and send an order (push the button and turn the
ming/off), 2 potentiometers and a 7 segments display potentiometer) in order to return in normal
display, mode.
- A slave system, with a 7 segments display and a The dimming control is done by the use of a triac
plug for dimming control. (BTA08-600TW) so the load connected to the plug
When the user presses the key (command), or must not exceed 1000W.
turns a potentiometer, the master system sends a
message, lights the decimal point on and waits an III.2 - Schematics (see Figures 15 and 16)
acknowledge. The remote board receives the mes-
sage, sends an acknowledge and does the order. This section gives the schematics of the two
boards. pB7, pC0 and pA2 have different meaning
If no problem occurs, the master system receives
the good acknowledge and switches the decimal on the master and on the slave board, that ’s why
we give two schematics. But it is possible to make
point off. Otherwise, after trying sending the mes-
a single board with dual implantation.
sage 3 times, the decimal point remains lighting : a
communication error occurs. Warning : on this board the VDD is connected (via
With the push-button, you can turn the light off or 0Ω resistor) to the neutral mains.
on. With the dimmer potentiometer, you can control That means all the board is on the Mains supply
the light intensity. With the display potentiometer, voltage!
Figure 14 : Dimmer Control Application Description
Mains
ST7537 ST7537
Mains plug
Dimming/off
Dimmer Display
AN535-11.AI
11/20
REMOTE CONTROL USING ST7537 AND ST6
ST6265
J1 : jumper for 50/60Hz selection
B0 B1 B2 B3 B4 B5 B6 C0 A2 B7
2.2kΩ
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω
1kΩ
J1 VDD 0Ω Neutral
4.7kΩ
G A B C D E F
A 2N2907 33Ω
G A1
820Ω
F B BTA08-600TW
A2
G
LOAD
E C 1MΩ
Phase
6.8nF
DP
D
AN535-12.EPS
VDD
ST6265
B0 B1 B2 B3 B4 B5 B6 B7 A2 A3 C0
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω
220Ω
Push
VDD Button
G A B C D E F
A 470Ω
P1 P2
F B
G
P1, P2 : 100kΩ linears
E C
DP
DP
D
AN535-13.AI
VDD
12/20
REMOTE CONTROL USING ST7537 AND ST6
III.3 - Pins Description & Software Initialisation - C0 is connected to a push-button, and has to be
programmed in input with pull-up,
III.3.1 - Slave Board - A2 and A3 are input for analogic values coming
On this board, there is a 7 segments display appli- from the potentiometers, so they have to be pro-
cation and a dimmer application. grammed in input, and reading an analogic value
The display application is very simple. The pins B0 is done by programming one of these two pins in
to B6 have to be programmed in output with pull-up analog input, but not both in the same time.
(push-pull). They are connected to the display by Table 11 : Master System Pins Configuration
220Ω resistors to limit the LED current. The display Byte
is a common anode so the pins have to be reseted Bits
Register Value Description
Values
to make the display lighting. (e.g.)
The dimmer application is most sophisticated, be- DDRA D2 res 00 h A2 in input
D3 res A3 in input
cause it requires a zero crossing detection, and the
possibility to wait a delay before firing the triac. See ORA D2 res/set 04 h (A2 in input analog
D3 set/res /08 h A3 in input) / (A3 in
dimmer control part for more information. input analog A2 in
DRA D2 set 0C h
The pin A2 is connected to the phase (via 1MΩ), in D3 set input)
order to provide the zero crossing. This needs DDRB D0..D7 set FF h B0..B7 in output
Neutral connected to VDD to have a reference level. ORB D0..D7 set FF h B0..B7 in push-pull
A2 has to be programmed in input. output set to 1
The pin B7 has to be programmed in push-pull DRB D0..D7 set FF h
output to provide the pulse. B7 is the only pin that DDRC D0 res 00 h C0 in input
is connectedto Auto Reload timer, so the fire signal ORC D0 res 00 h
needs to be amplified before driving the triac (the C0 with pull-up
DRC D0 res 00 h
amplification stage is realised with a PNP transis-
tor). At reset state B7 is configured in input with III.4 - Dimmer Control
pull-up, so B7 is held at VSS by a 2.2kΩ resistor.
This application is working with both 50Hz and III.4.1 - General Description
60Hz mains. The jumper connected to C0 is used This section describes the main aspect of the
to select between the two type of mains. Co has to power control system used on the slave system.
be programmed in input with pull-up. For further details, refers to power control applica-
The pin configuration is the following : tions notes.
Table 10 : Slave System Pins Configuration The output power is controlled by the phase delay
of the triac drive. This delay is referred to the zero
Byte
Register
Bits
Value Description crossing of the line voltage. That needs an addi-
Values tional connection to main voltage, but in a remote
(e.g.)
DDRA D2 res 00 h A2 in input application, this is not a problem.
ORA D2 res 00 h
A2 in input Figure 17 : Power Control Based on the
DRA D2 set 04h Monitoring of the Zero Crossing of
DDRB D0..D7 set FF h B0..B7 in output the Voltage
ORB D0..D7 set FF h B0..B7 in push-pull R L
DRB D0..D7 set FF h output set to 1
DDRC D0 res 00 h C0 in input VLOAD
ORC D0 res 00 h V LINE
C0 with pull-up
DRC D0 res 00 h Vg
13/20
REMOTE CONTROL USING ST7537 AND ST6
pA2
pB7
14/20
REMOTE CONTROL USING ST7537 AND ST6
III.5.2.2 - Registers for Power Control Figure 20 : Application Recover and Dimmer
The application register is used to store the dim- Procedure Flows
ming status (on/off) and the zero crossing voltage.
Table 13 : Application Register Definition a) 1 b) 1
Application Dimmer
Recover Application
D0 D1 D2 D3 D4 D5 D6 D7
lght_on zero_dt 0 0 0 0 0 0
AN535-17.EPS
- Dimm_ctrl check if a new value has arrived for End Ret
dimmer, calculate the new delay and eventually
switch off or on the dimmer control,
- Aff_value checks if a new value has arrived for Figure 21 : Application Recover and Button and
display, calculate the new digit and display it, Potentiometer Control Procedure
- get_level is a macro that get the level of the main Flows
voltage (1 for positive voltage and 0 for negative)
and that modify the zero_dt bit of application 1 1
register. This macro avoids delayed zero crossing Button and Application
Potentiometers Recover
detection.
In the right flow : see Figure 20b
- Zero crossing detectionis done by comparing the 3
2 6
instantaneous level (on pA2 pin) with the bit Button Yes Send Order : Call
Switch aff_value
zero_dt in application register, Pressed?
Dimmer
- AR timer control loads the arrc value correspond- No
ing to time delay, launch the timer, reload arrc
value for a 10ms delay and arcp for the pulse 5
3 6 End
width. Display Yes Send Order :
Potentiometer New Value
Turned? for Display
III.5.2.4 - Push-button
No
The detection of an action on the button is made
simply by reading the value on pin C0. If somebody 4
push on it the MCU sends a frame and waits for an Dimmer No
Application
acknowledge. This action needs more than 130ms On?
so it makes a kind of debounce. Yes
III.5.2.5 - Potentiometers 5 6
Dimmer
The main program reads the converted value on Potentiometer
Yes Send Order :
New Delay
potentiometers,and compares it to the stored value Turned? for Dimmer
AN535-18.AI
AN535-21.EPS
Ack. Fram e
PLM PLM PLM PLM
COM. COM. COM. COM.
Figure 22 Unit 4 Unit 3 Unit 2 Unit 1
Mains
With several units, the timing is the same, but even
if a unit is not concerned with a communication, it
Order Frame has to get the frames in account for timing control.
ST7537 ST7537
Ack. Frame For instance, it has to reload its time to keep silent.
AN535-20.EPS
PLM PLM
COM. COM. And if several units have reload there time to keep
Unit T Unit R silent at the end of a communication, the values
reloaded must be different to avoid conflicts on the
The unit T checks that the network is free for access next communication. Again, a random value is
thanks to the Carrier Detector, then it sends its added to make timing different.
frame and waits an acknowledge during a delay Here is a data timing chart of the transmitted signal
Twack. The unit R receive a frame and sends an of the different units (see Figure 24).
acknowledge if R is the destination of the frame. R Anyway, all units must send there message in less
must send the ack. frame before the end of Twack. than two seconds.
16/20
REMOTE CONTROL USING ST7537 AND ST6
Figure 24
Message Message to U2 U1
Tretans Twack
Ack. U2
AN535-22.EPS
Ack. U5
In order to implement these timing, an easy way is You will be able to have good communication with
to use a single timer and several registers corre- a receive signal of around 50dBµV which means a
sponding to the different delays you want to count. dynamic of around 70dB.
The timer will decrease the registers at each over- Because we want to get the benefit of the very good
flow, and the counters are ”launched” by loading a sensitivity of the ST7537, we will program Txd to
value in the corresponding register. An example of ”0” in receive mode and create by soft a frame
implementation on ST6265 is given in part III. detector . We will use the CD signal as mentioned
This access protocol allows an additional network by CENELEC only when we want to transmit a
priority: if you allow unit 1 (U1) to transmit before frame . Different software frame detector can be
unit 2 (U2), then U1 will always sends its messages implemented depending of the resources of your
before U2, and will have a highest network priority. microcontroller. You can program your microcon-
By choosing the range of TsilentR of a unit, you will troller to go in receive frame when it received the
then choose its priority. expected byte.
Values for TsilentR.
Figure 25
Range Priority
85..94ms Highest priority
AN535-23.EPS
IV.2 - Example of Implementation of Soft Car- So the preamble is for demodulator training (when
rier Detector you start a communication the 3 first bits are lost
We have seen that by programming the TxD to ”0” by the receiver) and when you will match with
in receive mode we increase the sensitivity of the expected byte the microcontroller will go in receive
ST7537 because there is no more clamping by CD. frame routine.
17/20
REMOTE CONTROL USING ST7537 AND ST6
On the ST6 microcontroller we have implemented With this way of programming , the places where
the following frame detector. counters are loaded are very significant :
- Xmit_count is loaded at the end of the message
Figure 26 sending procedure in order to wait an acknow-
ledge (30ms) and at the end of the reception of a
RxD good acknowledge (time between two transmis-
AN535-24.EPS
RANDOM DATAS ”1” FFh DATA sions of the same device : 125ms).
FRAME - Rmit_count is loaded at the end of a reception
with a random value (time between two transmis-
We put Txd =” 1” on the transmitter for around 4ms sion of different devices : 85 to 115ms).
(for demodulator training) and The timer will allow the sending of a frame after
after we send in asynchronous mode FFh following C.S.M.A. delays.
by the complete frame. On the receiver , we check Figure 27 : Sending a frame after C.S.M.A
that we have RxD equal to ”1” for at least 7ms (we Delays
are looking for FFh) , then we go in receive and we
will have frame synchronisation on the first start bit
of the data. SEND_FRAM
We did a trial in our lab with this system during
2 hours without having the ST6 going in frame
receive routine on bad datas dued to noise signal.
18/20
REMOTE CONTROL USING ST7537 AND ST6
V - CONCLUSION
The ST7537 master and slave systems are demon- - Frame transmission : the transmission is asyn-
strative applications with low cost components. chronous with odd parity and there is a frame
These boards are realised with discrete compo- parity byte at the end of the frame, but if errors
nents but the size of these applications can be are detected, they are not corrected. A correcting
reduced by using a switching power supply and code should be implemented in less than
SMD (the ST7537 and the ST6265 are both avail- 200 bytes on ST6x,
able in small outline plastic). Severalimprovements - Power control : the 50Hz/60Hz detection should
should be done in order to make a more flexible be done automatically instead of using a jumper.
product : And the number of stages in dimming mode
- Network management : All the addresses are should be increased to obtain a pseudo-continu-
fixed except the slave system address (switches). ous variation.
The software should be able to change the Home
address, and objects addresses. This job needs All these modifications are realisable, because the
management frame reception, emission and con- program is less than 800 bytes long and the MCU
trol, is working at 5.5MHz, so there is place and CPU
- Byte transmission improvement : the software is time left. The software is divided in module, so parts
reading the value on Rxd pin only one time (at the can be removed, and mains programs source
half of the bit), it would be better to do it several (master.asm and slave.Asm) are less than
time to avoid spike perturbations, 300 lines long.
The master and slave programs are compiled without linker, but when using the powerctl.asm module the
option :
block 64% S64
is included in order to provide a good window banking for the tables in rom (AR values for dimmer
application). That makes the object code bigger than it is but it is the price to pay.
19/20
20/20
+5V MASTER
DP
1 1
1
RV1 2 RV2 2
R25 R24 BP1
100kΩ 100kΩ 220Ω 470Ω BP
3 3 2
+10V
1
1 2 2 Q8
10 pA0 OAOAO 22 C8 2 1 2N2907
C11
C15 100nF 2.2µF 3
4321 13 pA1 1 2
2.2µF
SW1 14 pA2 NMI 23 R11
VII - ANNEXE B : SCHEMATICS
180Ω 3
SW DIP4 1 1 2
15 pA3 C7 C10 2 Q4
5678 R13 4.7kΩ 100nF 2.2µF C9 2N2222
16 pA4 pC0 28 2 1 100nF
R9 R12
R14 4.7kΩ 1 2 47kΩ 2.2Ω 1
17 pA5
R15 4.7kΩ R10
18 pA6 pC1 27 2 14 27 26 5 2.2Ω
R16 4.7kΩ R2 1kΩ
AF1 19 pA7 A D D I T RAI 3
5082-7850 V V E F X
pC2 26 D D M O F 2
R17 220Ω IC2 PAFB 6 R4 C6
+5V 11 G 1 pB0 D D I I R8 1kΩ 2.2Ω 1µF
ST62E65 ATO 7 1
A R18 220Ω
3 1 A 2 pB1 pC3 25
1 VCM PABC/ 8 1
12 F B R19 220Ω
13 B 4 pB2 18 MCLK PABC 9 2 Q5
pC4 24 2N2907
R20 220Ω R3
G 10 C 5 pB3 +5V 19 WD/ IC1 TEST1 10 3 2.2Ω
REMOTE CONTROL USING ST7537 AND ST6
AN535-19.AI
Information furnished is believed to be accurate and reliable. However, SGS-THOMSON Microelectronics assumes no responsibility
for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result
from its use. No licence is granted by implication or otherwise under any patent or patent rights of SGS-THOMSON Microelectronics.
Specifications mentioned in this publication are subject to change without noti ce. This publication supersedes and replaces all
information previously supplied. SGS-THOMSON Microelectronics products are not authorized for use as critical components in life
support devices or systems without express written approval of SGS-THOMSON Microelectronics.
Purchase of I2C Components of SGS-THOMSON Microelectronics, conveys a license under the Philips
I2C Patent. Rights to use these components in a I2C system, is granted provided that the system conforms to
the I2C Standard Specifications as defined by Philips.
www.datasheetcatalog.com