Document 6498654

Transcription

Document 6498654
TOSHIBA
Application Brief
Ref No. [AB-M3-008 V1.00.002]
How to connect Hall Sensors to M370SK
Detailed Description
Compact
Architecture
Group
Product
Peripheral
External
Hardware
Status
By
ARM Cortex™-M3
Toshiba TX03
TMPM37x
Encoder
Hall Sensors
Hitex M370SK Starterkit
Code Not Verified
Toshiba Electronics Europe GmbH
European LSI Design Eng. Center - ELDEC
Email [email protected]
Introduction
Even the major purpose of the demonstration
software on the M370 Starterkit is to show sensorless vector control, it is still possible to connect
position detectors like hall sensors or incremental
encoder. How to do this is explained in this
application brief.
www.toshiba-components.com
Possible position detectors that can be connected to
the board are first distinguished between magnetic
hall sensors and incremental encoders. Electrically
these can be connected either with differential
signals or with unipolar signals.
The unipolar outputs are typically designed as opencollector. Therefore the on-board pull-up resistors
can be utilized. In this case it is required to remove
the 470Ω termination resistor.
Schematics
The schematic shows how the different connections
can be realized. For Hall Sensors with differential c
or unipolar d connection or for encoders with
differential output e or digital signal output f.
TOSHIBA
August 2010
Application Brief
AB-M3-008 V1.00
Source Code
DISCLAIMER
Listed below is the initialization code for the two
encoder blocks of TMPM370. ENC0 is set for
incremental encoder input, ENC1 is initialized to
support three phase hall sensor input.
RESTRICTIONS ON PRODUCT USE
TOSHIBA is continually working to improve the quality
and reliability of its products. Nevertheless,
semiconductor devices in general can malfunction or
fail due to their inherent electrical sensitivity and
vulnerability to physical stress. It is the responsibility of
the buyer, when utilizing TOSHIBA products, to
comply with the standards of safety in making a safe
design for the entire system, and to avoid situations in
which a malfunction or failure of such TOSHIBA
products could cause loss of human life, bodily injury
or damage to property. In developing your designs,
please ensure that TOSHIBA products are used within
specified operating ranges as set forth in the most
recent TOSHIBA products specifications. Also, please
keep in mind the precautions and conditions set forth
in the “Handling Guide for Semiconductor Devices,” or
“TOSHIBA Semiconductor Reliability Handbook” etc.
•
The TOSHIBA products listed in this document are
intended for usage in general electronics applications
(computer, personal equipment, office equipment,
measuring equipment, industrial robotics, domestic
appliances, etc.). These TOSHIBA products are
neither intended nor warranted for usage in equipment
that requires extraordinarily high quality and/or
reliability or a malfunction or failure of which may
cause loss of human life or bodily injury (“Unintended
Usage”). Unintended Usage include atomic energy
control instruments, airplane or spaceship instruments,
transportation instruments, traffic signal instruments,
combustion control instruments, medical instruments,
all types of safety devices, etc.. Unintended Usage of
TOSHIBA products listed in this document shall be
made at the customer’s own risk.
•
The information contained herein is presented only as
a guide for the applications of our products. No
responsibility
is
assumed
by
TOSHIBA
CORPORATION for any infringements of intellectual
property or other rights of the third parties which may
result from its use. No license is granted by implication
or otherwise under any intellectual property or other
rights of TOSHIBA CORPORATION or others.
•
The information contained herein is subject to change
without notice.
/* Encoder0 Initial set & Start M370 */
void ENC0_init(void)
{
// Encoder pulse set
ENC0->ENCRELOAD = VE0_EncPulseNum*VE0_EncMultiple-1;
ENC0->ENCINT = 0x0000;
// Don’t use CMP
ENC0->ENCTNCR = ENC_NOISEFILTER_127|
ENC_RUN_ENABLE|
ENC_ZPHASE_ENABLE|
ENC_MODE_ENCODE ;
__DSB();
// SYNC
}
/* Encoder1 Initial set & Start M370 */
void ENC1_init(void)
{
ENC_IOInit(ENC1);
ENC1->ENCRELOAD = 0x0000;
// Encoder pulse set
ENC1->ENCINT
= 0x0000;
// Don’t use CMP
ENC1->ENCTNCR
= ENC_PULSE_DIV1|
ENC_NOISEFILTER_31|
ENC_RUN_ENABLE|
ENC_MODE_SENSOR_EVENT|
ENC_3PHASE_ENABLE|
ENC_IRQ_ENABLE ;
__DSB();
// SYNC
IRQ_Enable(INTENC1_IRQn, Enable);
}
Mandatory header files not shown here.
Using the encoder block inside of the Toshiba
microcontroller will unload the processor from routine
work.
[1] Toshiba TMPM370 Datasheet 20100709.
www.toshiba-components.com
000707EAA
•
#define VE0_EncPulseNum 2048 // Number of Encoder pulse
#define VE0_EncMultiple 4
//
References
Page 2 of 2
TOSHIBA
August 2010