công cụ tìm kiếm bảng dữ liệu linh kiện điện tử
  Vietnamese  ▼
ALLDATASHEET.VN

X  

AN2159 bảng dữ liệu(PDF) 17 Page - STMicroelectronics

tên linh kiện AN2159
Giải thích chi tiết về linh kiện  SPI protocol for STPM01/STPM10 metering devices
PDF  23 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
nhà sản xuất  STMICROELECTRONICS [STMicroelectronics]
Trang chủ  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2159 bảng dữ liệu(HTML) 17 Page - STMicroelectronics

Back Button AN2159 Datasheet HTML 13Page - STMicroelectronics AN2159 Datasheet HTML 14Page - STMicroelectronics AN2159 Datasheet HTML 15Page - STMicroelectronics AN2159 Datasheet HTML 16Page - STMicroelectronics AN2159 Datasheet HTML 17Page - STMicroelectronics AN2159 Datasheet HTML 18Page - STMicroelectronics AN2159 Datasheet HTML 19Page - STMicroelectronics AN2159 Datasheet HTML 20Page - STMicroelectronics AN2159 Datasheet HTML 21Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 17 / 23 page
background image
AN2159
Converting readings into measured values
Doc ID 11400 Rev 3
17/23
old and e
new energy values; then e old value should be rewritten with e new
value in order to enable a correct
e
quant computation next time.
When
e
frac would collect a certain amount of energy, let say 10 Wh for active energy
(corresponding to a certain threshold value according to KAW), e integ should change for
1 bit and the
e
frac should change by the threshold value.
This way
e
frac stores 0.01 kWh, after which e integ is increased by one, and e
integ variable will hold accumulated energy of which the least significant bit will represent
10 Wh.
Considering an active energy meter where P = 64000 imp/kWh, for a step of 0.01 kWh = 10
Wh, since each bit of e'quant represents KAW Wh (is the same resolution of internal energy
counter, because
e
quant is calculated as a difference of two energy counter values),
the threshold value will be 10 / KAW = 10 * 2^17 = 0 x 140000.
In a microcontroller based application, a high priority timer interrupt should be set to perform
measuring tasks every 1/512 s. Within this interrupt service 16 different subtasks could be
established in order to broke the whole meter task into 16 shorter consecutive subtasks
(reading of device's register, checking the data read and if OK, computing the value of
e
quant, ...). In this way the main program and other interrupt services are not blocked for
more than few 100 µs every 2 ms, and the meter task will be completed in 16 steps - that is
in 1/32 s.
The interrupt service should do the following:
update
e
frac and e integ of energy variable using e quot = e quant / 16
generate output pulses (if needed) from
e
frac
call the next subtask
perform other tasks (if needed)
In this way the addition of
e
quant is split in 16 times. This generates a microcontroller
output pulse that has a 16 times better accuracy of position in time. In fact the period of
reading would be 1/32 s = 31.25 ms. If the whole value of
e
quant would be added to the
final energy register
e
frac, only 31.25 ms resolution of output pulse position would be
possible, which would be seen as a jitter just by eye looking to the LED. Using suggested
method the resolution of output pulse position would be 1.95 ms, which is short jitter enough
that nobody would see it.
Below an example of subtasks organization is given:
subtask_0: latch the values in the STPMxx
subtask_1: read the STPMxx
subtask_2: repeat the reading of STPMxx (without latching again) and stop SPI
communication
subtask_3: verify the parity codes of registers and equality of both readings, result is flag OK
subtask_4: if OK unpack values of registers read from STPMxx
subtask_5: if OK process STPMxx status
subtask_6: if OK compute
e
quant and update e old of active energy
subtask_7: if OK compute
e
quant and update e old of reactive energy
subtask_8: if OK compute
e
quant and update e old of apparent energy
subtask_9: if OK calculate Vrms and Irms,



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23


bảng dữ liệu tải về

Go To PDF Page


Link URL



Cho đến nay ALLDATASHEET có giúp ích cho doanh nghiệp của bạn hay không?  [ DONATE ] 

Alldatasheet là   |   Quảng cáo   |   Liên lạc với chúng tôi   |   Chính sách bảo mật   |   Liên kết đến bảng dữ liệu    |   Trao đổi link   |   Tìm kiếm theo nhà sản xuất
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com