View
19
Download
0
Category
Preview:
Citation preview
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 1 / 8 November 23, 2020
BP45F0044 Wireless Electric Toothbrush Application Note
D/N: AN0569EN
Introduction
Wireless rechargeable toothbrushes are divided into two main parts, a wireless charging transmitter
(Tx) and a sonic electric toothbrush (Rx). Communication between these two parts is one-way from
the toothbrush to the charging base. Holtek provides the charging base communication function,
which can enable the charging base to receive toothbrush status, ID, toothbrush presence, etc. The
communication principle is based on AM load modulation. The toothbrush terminal uses a resistor
and a transistor to control the load to change the current. When the charging base receives these
changes in current, it can then implement communication using the integrated OCP, CMP and
demodulation algorithm after RC filtering.
This application note describes the transmitter communication demodulation and how to use the
Holtek Library to implement wireless electric toothbrush communication.
Functional Description
The charging base hardware design is shown in Figure 1. In the initial standby state, the charging
base will Ping transmitting power to the toothbrush at regular intervals. If the toothbrush receives
a Ping action, the charging base will demodulate the returned code. If the ID code is correct, the
charging base will then continuously transmit power to charge the toothbrush. During this period,
the toothbrush will send back its ID code to indicate the toothbrush presence at regular time
intervals. Holtek has integrated the parameters that users will encounter into the program and has
provided related subroutines for the user to call. Users can quickly adjust these parameters and
implement an ID identification function according to this application note.
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 2 / 8 November 23, 2020
Figure 1. Charging Base Application Circuit
Operating Principles
1. Charging base coil:
Inductance: 32.01µH
Type: cylindrical, 8mm in height, 10mm in diameter, with magnetic column
2. Toothbrush coil:
Inductance: 53.59µH
Type: cylindrical, 9mm in height, 15mm in diameter, without magnetic column
3. Connection between the charging base and the toothbrush:
The distance between the charging base and the toothbrush is about 4mm. The coil type is
shown in Figure 2.
Figure 2. Charging Base Coil (Left) and Toothbrush Coil (Right)
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 3 / 8 November 23, 2020
Hardware Description
The toothbrush terminal AM extracted load current circuit is shown in Figure 3.
The toothbrush uses a resistor and NPN transistor to control load changes. As the charging base
terminal will result in a current difference when the load changes, the charging base can implement
demodulation by monitoring this difference.
Figure 3. Toothbrush Extracted Load Current Circuit
The BP45F0044 device provides users with a complete charging base demodulation solution,
including an integrated OCP with programmable amplifier gain, adjustable DAC, comparator and
decoding debounce. The wireless charging transmission and demodulation functions can be
implemented using these internal hardware circuits together with the decoding algorithm provided
by Holtek. The demodulation block diagram of the BP45F0044 device is shown in Figure 4.
The OPA will be configured to operate in the non-inverted mode, where S0 and S3 are on and S1
and S2 are off. The sampling resistor signal R1 is connected to the OCPI pin, amplified up to 50
times using the OPA and then compared with the DAC value. The DAC value can be obtained by
directly calling the Holtek program subroutine "OCP_demo_trim" to complete the calibration. The
CMP output will be demodulated by the algorithm after the filter debounce.
TX decoding DAC
TX decoding debounce
Sampling amplifier gain adjustment Figure 4. Charging Base Decoding Block Diagram
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 4 / 8 November 23, 2020
Software Description
The details for the customised communication packet format is described as follows.
Complete Packet Format
The complete packet format is composed of 5 bytes of data, including Preamble, 3 bytes of data
and checksum. Details are as follows:
Figure 5. Complete Packet Format Diagram
The user-defined data is c_ID_H, c_ID_L and c_Rx_STA, 3 bytes in total.
The complete packet format includes:
Preamble (11~25 bits, all =‘1’)
Toothbrush ID (3 bytes)
Checksum (1 byte)
Toothbrush ID Setting
Before the charging base implements demodulation, the Rx terminal should be prepared with
the corresponding settings. In the toothbrush terminal program provided by Holtek, 2 bytes of
data is used as the toothbrush ID code and 1 byte of data is used as the user-defined data. Users
can find the following parameters in the my_define.h file in the toothbrush program of the
attachment file.
c_ID_H: Toothbrush ID code - high byte
c_ID_L: Toothbrush ID code - low byte
c_Rx_STA: Toothbrush customised parameters
Toothbrush Sending Code Program
In addition to the toothbrush terminal ID setting, the subroutine "madulation_function()" should
be called in the program. By calling this program, the toothbrush can send the above-mentioned
three parameters of c_ID_H, c_ID_L and c_Rx_STA, which have already been called in the
complete toothbrush program provided by Holtek. Users can also modify the aforementioned
ID.
Charging Base Decoding OCP Setting
The sampling resistor should be selected to match the power, this resistance is usually between
0.1Ω~1Ω. A voltage signal will be generated according to the resistance value. After RC
filtering, a more useable voltage difference will be obtained using the OCP operational
amplifier which has a programmable gain. In this example, the sampling resistor R1 is 250mΩ,
the amplifier gain is 50 by default and the filter debounce time selects 64. See Figure 1.
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 5 / 8 November 23, 2020
CH1:Waveform after sampling resistor filtering
CH2:Demodulated waveform
Figure 6. Charging Base Demodulation Waveform
As shown in Figure 6, after the filtering shown in CH1, the signal is composed of a sinusoidal
waveform with a small amplitude and many spikes. After the signal enters the OCP non-
inverted mode, the signal will be firstly amplified by the OPA to increase the sinusoidal
waveform amplitude. If the CMP compares the central position of the sinusoidal waveform, it
can then be correctly demodulated. However, the component errors in the coil or sampling
resistor must be taken into account. To resolve this, Holtek has devised a way to make the DAC
adaptive to ensure that for each demodulation, the DAC can output a central value of the
sinusoidal waveform, which the CMP can compare to allow the MCU to correctly demodulate
the waveform. The signal spikes are filtered by the debounce operation, the demodulated
waveform for this is shown as CH2.
Holtek has simplified the adaptive program to make the adjustment method easier to use. Users
only need to call "OCP_demo_trim" in the program to complete the calibration of the
comparator voltage for the sinusoidal waveform. If there is a deviation in the demodulation
waveform, the parameter "c_OCPDA_offset" can be trimmed.
The OCP_demo_trim operation is as follows:
1. When the PWM function is initiated, it needs to wait for some time. The wait time is about 200µs in this application.
2. CALL OCP_demo_trim.
3. If there is a deviation in the OCP_COUT waveform, this can be resolved by trimming the "c_OCPDA_offset".
Demodulation Program
The packet demodulation results of the charging base are obtained by a series of complex
algorithms. Holtek has shortened the user development time by calling the demodulation
subroutine. After users have debugged according to the aforementioned "Charging base
decoding OCP setting", the subroutine "Demodulation" is called every 50µs and the flag "
user_fg_demodu_ok" is checked to ensure that the ID code is correct. When the Demodulation
continues comparing until the c_ID_H and c_ID_L parameters are the same as the toothbrush
terminal setting, the flag user_fg_demodu_ok will be set high.
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 6 / 8 November 23, 2020
Toothbrush ID Identification
The Holtek wireless rechargeable electric toothbrush solution provides users with a complete
and convenient ID identification function. At the same time, it can also adjust the PWM
operating time, Ping interval time, toothbrush not-present time and other parameter settings. It
also allows the toothbrush to have a customised 8-bit data capacity, where users can have data
transmission for information such as toothbrush status, battery voltage etc. The various
definable parameters of the charging base are explained as follows. Parameters Name Functional Description
c_ID_H User-defined ID code - high byte c_ID_L User-defined ID code - low byte c_PWM_ON_time PWM ping on time, units are 10ms c_ping_cycle PWM ping cycle (ON+OFF time), units are 10ms
c_time_out_after_success The time the toothbrush is not present in the charging base, the charging base will return to the ping state, units are 10ms
Subroutine Name Functional Description Change Flags and Parameters Flag Description
PWM_ping_cycle
The charging base transmits a Ping to check whether the toothbrush is present (call every 50µs)
fg_dac_cal
A DAC calibration will be performed before the charging base transmits power. It will then transmit a Ping to check whether the toothbrush is present. If the toothbrush is present, a DAC calibration will no longer be executed. 0: No calibration required 1. Calibration in progress
time_init Load the user-defined parameters
Load the user-defined parameters: c_PWM_ON_time, c_ping_cycle, c_time_out_after_success
—
OCP_demo_trim The CMP comparison voltage used for decoding is automatically calibrated
OCPDA OCP DAC comparison parameter
Demodulation
Demodulate program and check to see if the demodulation has been successful
user_fg_demodu_ok 0: Demodulation failed 1: Demodulation successful
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 7 / 8 November 23, 2020
Charging Base Flow Chart
After adjusting the above parameters, the charging base subroutine call flow is shown in the
accompanying figure. This flow has been implemented in the program provided by Holtek,
which users can use directly without changing the flow.
Start
Initialization
PWM_ping_cycle
user_fg_demodu_ok
Rx full charge?
No Yes
Re-timing for 2.5sCharging Flag =1
Yes
Yes
No
OCP_demo_trim
Charging Flag =1?
LED on
PWM off0.3s ?
0s ?No
Yes Yes
LED off2.5s finish?YesNo
No
Demodulation
Figure 7. Charging Base Flow Chart
Conclusion
Through this application note, users can quickly debug the demodulation parameters in the program,
and obtain ID information and customised data. Users can choose an appropriate solution according
to their circuit requirements. For any problems encountered with parameter debugging and coil
selection, contact local agents for assistance.
Reference Material
Reference document: BP45F0044 Datasheet.
For more details consult the Holtek website at www.holtek.com.
BP45F0044 Wireless Electric Toothbrush Application Note
AN0569EN V1.00 8 / 8 November 23, 2020
Revision and Modification Information
Date Author Issue Release 2020.05.06 Minhsien, Zheng V1.00
Disclaimer
All information, trademarks, logos, graphics, videos, audio clips, links and other items appearing
on this website ('Information') are for reference only and is subject to change at any time without
prior notice and at the discretion of Holtek Semiconductor Inc. and its related companies
(hereinafter 'Holtek', 'the company', 'us', 'we' or 'our'). Whilst Holtek endeavors to ensure the
accuracy of the Information on this website, no express or implied warranty is given by Holtek to
the accuracy of the Information. Holtek will bear no responsibility for any incorrectness or leakage.
Holtek will not be liable for any damages (including but not limited to computer virus, system
problems or data loss) whatsoever arising in using or in connection with the use of this website by
any party. There may be links in this area, which allow you to visit the websites of other companies.
These websites are not controlled by Holtek. Holtek will bear no responsibility and no guarantee to
whatsoever Information displayed at such sites. Hyperlinks to other websites are at your own risk.
Limitation of Liability
In no event shall Holtek Limited be liable to any other party for any loss or damage whatsoever or
howsoever caused directly or indirectly in connection with your access to or use of this website, the
content thereon or any goods, materials or services.
Governing Law
The Disclaimer contained in the website shall be governed by and interpreted in accordance with
the laws of the Republic of China. Users will submit to the non-exclusive jurisdiction of the
Republic of China courts.
Update of Disclaimer
Holtek reserves the right to update the Disclaimer at any time with or without prior notice, all
changes are effective immediately upon posting to the website.
Recommended