STPM01 and P89LPC9401 interface design
STPM01 SPI interface is a two-wire interface, the data input and output pins are the same, with the standard three-wire SPI interface is different. We use the method shown in Figure 3 to connect the two chips.
As the SPI bus master, LPC9401 output clock signal, STPM01 accordance SCLNLC clock signal for communication. To improve the anti-jamming performance, in series connection in a 10 ~ 100Ω resistor that chip pin input capacitance form a low-pass filter to filter out interference on the connection. When LPC9401 read STPM01 data, use the SPI module chip. And when you write data to STPM01 not use SPI bus control module, and the use of software simulation SPI timing output data. This is designed to consider the meter is running, LPC9401 STPM01 rarely write data to and reading data very frequently. This design takes full advantage of the chip's resources, improve the operating efficiency of the program.
Sampling circuit design
Voltage sampling resistor divider, taking into account the limited breakdown voltage chip resistors, the choice of four 200kΩ resistor divider to do. STPM01 maximum voltage channel input differential voltage is ± 0.3V, for 50Hz AC, corresponding valid values 0.21VRMS, the input signal can not be larger than this maximum, otherwise there will be clipping. Taking into account the margin for the rated voltage of 220V, we take 0.16VRMS, then
Sampling resistor = 200 × 4 × 0.16 / 220 = 581Ω, 560Ω we have chosen as the sampling resistor.
Phase current sensor we use transformers, variable ratio of 5,000: 1. The channel gain is set to 8, the maximum input signal is 0.105VRMS, taking into account a certain margin, in the 40A, the input signal selection around 0.08VRMS, the transformer load resistance of 0.08 / 40 × 5,000 = 10Ω.
We use the zero line current channel manganin shunt, shunt resistance take 250μΩ.Resistance can not get too big or too small, if the election is too small, the sampling in the small current signal is too weak, causing the error increases, easy-tolerance. If you choose too large, the large current shunt heat is too large, resulting in errors instability.
Figure 3: SPI interface diagram.
For 250μΩ shunt, the voltage at both ends of the signal 40A is 250 × 40 = 10,000μV, i.e. 10mVRMS. The sampling signal is very small, so the channel should be set to the maximum gain that is 32 times, the maximum amplitude of the signal input at this time is 26.25mVRMS.The actual maximum input signal is less than the maximum allowable input signal, shunt resistance reasonable choice.
No comments:
Post a Comment
Please comment