Sample code for PCA9629 operation

Dependencies:   mbed PCA9629

What is "PCA9629" ?

Information

The stepper motor controller PCA9629A is available now!
This "A-version (PCA9629A)" is a feature extended version on "non-A (PCA9629)".
If you are thinking new design, the PCA9629A can be a good option.

The PCA9629A has several new features like on-the-fly speed change, extended ramp controls, filter settings for GPIO port inputs, braking and releasing by timeout.. and more.

Please find detail information here. The "A-version" chip is pin-compatible to "non-A". So it can be replaced easily.
The register mapping and bit fields are re-defined. Those should be cared by software.
A sample code and a class library are available for mbed.

Import programPCA9629A_Hello

Hello program for PCA9629A. Demonstrates basic operations of PCA9629A component library.

Import libraryPCA9629A

PCA9629A component library

A Stepper motor controller

/media/uploads/nxp_ip/9629x5-bd-s.jpg
PCA9629 (x5) demo board: PCA9629, 4x FETs and stepper motor

The PCA9629 is an I2C-bus controlled low-power CMOS device that provides all the logic and control required to drive a four phase stepper motor. PCA9629 is intended to be used with external high current drivers to drive the motor coils. The PCA9629 supports three stepper motor drive formats: one-phase (wave drive), two-phase, and half-step. In addition, when used as inputs, four General Purpose Input/Outputs (GPIOs) allow sensing of logic level output from optical interrupter modules and generate active LOW interrupt signal on the INT pin of PCA9629. This is a useful feature in sensing home position of motor shaft or reference for step pulses. Upon interrupt, the PCA9629 can be programmed to automatically stop the motor or reverse the direction of rotation of motor.

/media/uploads/nxp_ip/block-diagram0.png
Communicate with mbed through I2C. The motor can be operated by register settings

Output wave train is programmable using control registers. The control registers are programmed via the I2C-bus. Features built into the PCA9629 provide highly flexible control of stepper motor, off-load bus master/micro and significantly reduce I2C-bus traffic. These include control of step size, number of steps per single command, number of full rotations and direction of rotation. A ramp-up on start and/or ramp-down on stop is also provided.

/media/uploads/nxp_ip/pca9629_16steps_w_ramp_control.png
Waveforms: Lower 2 lines are I2C bus. Upper 4 lines are output for motor driver stage
Motor moving 16 steps with acceleration and deceleration after register setting via I2C

The PCA9629 is available in a 16-pin TSSOP package and is specified over the -40 deg-C to +85 deg-C industrial temperature range.

/media/uploads/nxp_ip/dsc_0103_-1-.jpg
TSSOP16 package

Datasheet is available at next URL.
http://www.nxp.com/documents/data_sheet/PCA9629.pdf

Hardware

A sample schematic diagram is shown in next picture.

/media/uploads/nxp_ip/sample-sch.png

This schematic diagram shows a sample of the PF35T-48C stepper motor. It is using 12V supply voltage for motor and driving by SI3812DV FETs.
Pull-up resisters: For /RESET and /INT pins : 4.7K-ohms, for I2C signals (SDA and SCL) : >1.3k-ohms.

NOTE

For the correct operation of the "auto interrupt" demo, the GPIO port P0(pin1) and P1(pin2) must be connected to sensor input. signal edge of those pins are treated as the interrupt.

Sample code

This sample code operates the PCA9629 using its class library.
For the details of the library, please find information in library page.

Import libraryPCA9629

PCA9629 a stepper motor controller class library

API details are available in here

This program targets PCA9629 which has I2C address of 0x42 on I2C bus on pin28 and pin27 of mbed. 4 types motor actions are demonstrated in sequence (following 1..4 steps in loop).

  1. Simple motor turn demo
    • Motor moved 96 steps with 100pps (pulse persecond) speed
    • Then the motor turn reversed, move 48 steps by 50pps.
  2. Ramp control demo
    • total operation time = 2 seconds, initial speed = 40.69pps, rotations = 5turns+0steps, ramp-up enable = enable, ramp-down enable = enable, rotate direction = CW
    • The ramp control can be done with several register settings. The setting value calculation can be done by register setting tool (an Excel worksheet) from NXP.
  3. Auto interrupt demo
    • The GPIO inputs can be used as interrupt for PCA9629. The operation can be stopped or change the direction of turn.
    • This is turn direction auto reversing demo. Motor will switch the direction 12 steps after interrupt signal assertion.
    • The register setting of interrupt operation can be done by register setting tool also.
    • This demo works correctly only when sensor signals available on P0(pin1) and P1(pin2) input pins.
  4. Speed change demo
    • Changing motor speed in 5 steps from 55pps to 275pps.

Files at this revision

API Documentation at this revision

Comitter:
nxp_ip
Date:
Tue Apr 24 08:19:06 2012 +0000
Parent:
0:4f93f6ecf23c
Child:
2:2e75cedf6565
Commit message:
version 1.0

Changed in this revision

PCA9629.lib Show annotated file Show diff for this revision Revisions of this file
PCA9629/PCA9629.cpp Show diff for this revision Revisions of this file
PCA9629/PCA9629.h Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCA9629.lib	Tue Apr 24 08:19:06 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/nxp_ip/code/PCA9629/#aff87a1c8bd6
--- a/PCA9629/PCA9629.cpp	Fri Feb 03 04:05:49 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-/** A sample code for PCA9629
- *
- *  @author  Tedd OKANO, NXP Semiconductors
- *  @version 1.0
- *  @date    03-Feb-2011
- *
- *  Released under the MIT License: http://mbed.org/license/mit
- *
- *  An operation sample of PCU9629 stepper motor controller. 
- *  The mbed accesses the PCU9629 registers through I2C. 
- */
-
-#include    "mbed.h"
-#include    "PCA9629.h"
-
-#define     STEP_RESOLUTION     333333      //  1/(3e-6) = 333333
-
-char *reg_name[] = {
-    "MODE", "SUBADR1", "SUBADR2", "SUBADR3", "ALLCALLADR", "WDTC", "WDMOD", "IP",
-    "INTSTAT", "OP", "IOC", "MSK", "CLRINT", "INTMODE1", "INTMODE2", "INT_ACT_SETUP",
-    "INT_MRT_SETUP", "INT_ES_SETUP", "SETMODE", "PHCNTL", "SROTNL", "SROTNH",
-    "CWPWL", "CWPWH", "CCWPWL", "CCWPWH",
-    "CWSCOUNTL", "CWSCOUNTH", "CCWSCOUNTL", "CCWSCOUNTH",
-    "CWRCOUNTL", "CWRCOUNTH", "CCWRCOUNTL", "CCWRCOUNTH",
-    "EXTRASTEPS0", "EXTRASTEPS1", "RAMPX", "LOOPDLY", "MCNTL"
-};
-
-PCA9629::PCA9629(
-    PinName I2C_sda,
-    PinName I2C_scl,
-    char    I2C_address
-) : i2c( I2C_sda, I2C_scl ), i2c_addr( I2C_address ) {
-
-    i2c.frequency( 400 * 1000 );    
-    init_registers();
-}
-
-void PCA9629::init_registers( void ) {
-    char    init_array[] = { 0x80,                                                //  register access start address (0x00) with incremental access flag (MSB)
-                            0x30, 0xE2, 0xE4, 0xE6, 0xE0, 0x02, 0x10,             //  for registers MODE - WDCNTL (0x00 - 0x06
-                            0x00, 0x00,                                           //  for registers IP and INTSTAT (0x07, 0x08)
-                            0x07, 0x0F, 0x00, 0x0F, 0x0F, 0x00, 0x03, 0x02, 0x01, //  for registers OP - INT_AUTO_CLR (0x09 - 0x11)
-                            0x00, 0x00, 0x30, 0x00, 0x82, 0x66, 0x82, 0x06,       //  for registers SETMODE - CCWPWH (0x12 - 0x19)
-                            0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,       //  for registers CWSCOUNTL - CCWRCOUNTH (0x1A - 0x21)
-                            0x00, 0x00,                                           //  for registers EXTRASTEPS0 and EXTRASTEPS1 (0x22, 0x23)
-                            0x00, 0x00, 0x00                                      //  for registers RMPCNTL - MCNTL (0x24 - 0x26)
-                           };
-
-    set_all_registers( init_array, sizeof( init_array ) );
-}
-
-void PCA9629::set_all_registers( char *a, char size )
-{
-    int     error_code;
-
-    error_code  = i2c.write( i2c_addr, a, size );
-
-    if ( error_code )
-        error( "error @ initializing PCA9629" );
-}
-
-void PCA9629::write( RegisterName register_name, char value ) {
-    int     error_code;
-    char    cmd[ 2 ];
-
-    cmd[ 0 ]    = register_name;
-    cmd[ 1 ]    = value;
-
-    error_code  = i2c.write( i2c_addr, cmd, 2 );
-
-    if ( error_code )
-        error( "PCA9629 writing failed\r\n" );
-}
-
-void PCA9629::write( Register16bits register_name, short value ) {
-    int     error_code;
-    char    cmd[ 3 ];
-
-    cmd[ 0 ]    = register_name;
-    cmd[ 1 ]    = value & 0xFF;
-    cmd[ 2 ]    = value >> 8;
-
-    error_code  = i2c.write( i2c_addr, cmd, 3 );
-
-    if ( error_code )
-        error( "PCA9629 writing failed\r\n" );
-}
-
-char PCA9629::read( RegisterName register_name ) {
-    int     error_code;
-    char    cmd;
-    char    data;
-
-    cmd = register_name;
-
-    error_code  = i2c.write( i2c_addr, &cmd, 1, false );
-
-    if ( error_code )
-        error( "PCA9629 reading (command phase) failed\r\n" );
-
-    error_code  = i2c.read( i2c_addr, &data, 1 );
-
-    if ( error_code )
-        error( "PCA9629 reading (data phase) failed\r\n" );
-
-    return ( data );
-}
-
-short PCA9629::read( Register16bits register_name ) {
-    int     error_code;
-    char    cmd;
-    char    data[ 2 ];
-
-    cmd = register_name;
-
-    error_code  = i2c.write( i2c_addr, &cmd, 1, false );
-
-    if ( error_code )
-        error( "PCA9629 reading (command phase) failed\r\n" );
-
-    error_code  = i2c.read( i2c_addr, data, 2 );
-
-    if ( error_code )
-        error( "PCA9629 reading (data phase) failed\r\n" );
-
-    return ( data[ 1 ] << 8 | data[ 0 ] );
-}
-
-void PCA9629::start( Direction dir ) {
-    write( MCNTL, 0xA8 | dir );
-}
-
-void PCA9629::stop( void ) {
-    write( MCNTL, 0x00 );
-}
-
-short PCA9629::pps( Direction dir, PrescalerRange prescaler, int pps ) {
-    int     step_pulse_width;
-
-    step_pulse_width    = STEP_RESOLUTION / ((1 << prescaler) * pps);
-
-    if ( step_pulse_width & 0xE000 ) {  //error( "pps setting: out of range" );
-        step_pulse_width    = 0x1FFF;
-        printf( "the pps forced in to the range that user specified.. %fpps\r\n", (float)STEP_RESOLUTION / ((float)0x1FFF * (float)(1 << prescaler)) );
-    }
-    if ( !step_pulse_width ) {  //error( "pps setting: out of range" );
-        step_pulse_width    = 0x1;
-        printf( "the pps forced in to the range that user specified.. %fpps\r\n", (float)STEP_RESOLUTION / (float)(1 << prescaler) );
-    }
-
-    step_pulse_width    |= (prescaler << 13);
-
-    write( (dir == CW) ? CWPW_ : CCWPW_, step_pulse_width );
-
-    return ( step_pulse_width );
-}
-
-void PCA9629::rotations( Direction dir, int rotations ) {
-    write( (dir == CW) ? CWRCOUNT_ : CCWRCOUNT_, rotations );
-}
-
-void PCA9629::steps( Direction dir, int steps ) {
-    write( (dir == CW) ? CWSCOUNT_ : CCWSCOUNT_, steps );
-}
-
-
-void PCA9629::register_dump( void ) {
-    char    data[ 0x27 ];
-    char    cmd = 0x80;
-    int     i;
-    int     j;
-
-    i2c.write( i2c_addr, &cmd, 1 );
-    i2c.read( i2c_addr, data, sizeof( data ) );
-
-    printf( "PCA9629 register dump\r\n" );
-
-    for ( i = 0, j = 0x14; i <= 0x12; i++, j++ )
-        printf( "  %-13s (0x%02X): 0x%02X    %-13s (0x%02X): 0x%02X\r\n", reg_name[ i ], i, data[ i ], reg_name[ j ], j, data[ j ] );
-
-    printf( "  %-13s (0x%02X): 0x%02X\r\n", reg_name[ 0x13 ], 0x13, data[ 0x13 ] );
-}
-
-
-void PCA9629::speed_change( unsigned short pw ) {
-    char    cmd0[]   = { PCA9629::MCNTL, 0x00};                         //  data for stop the motor
-    char    cmd1[]   = { PCA9629::CW__STEP_WIDTH, pw & 0xFF, pw >> 8 }; //  data for rewrite pulse width
-    char    cmd2[]   = { PCA9629::MCNTL, 0xB4};   //  start             //  data for start again
-    wait_us(10);
-
-    i2c.write( i2c_addr, cmd0, sizeof( cmd0 ), true );  //  stop the motor
-    wait_us(50);
-    i2c.write( i2c_addr, cmd1, sizeof( cmd1 ), true );  //  rewrite pulse width
-    i2c.write( i2c_addr, cmd2, sizeof( cmd2 ), false ); //  start again
-}
-
-
-
--- a/PCA9629/PCA9629.h	Fri Feb 03 04:05:49 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +0,0 @@
-/** A sample code for PCA9629
- *
- *  @author  Tedd OKANO, NXP Semiconductors
- *  @version 1.0
- *  @date    03-Feb-2011
- *
- *  Released under the MIT License: http://mbed.org/license/mit
- *
- *  An operation sample of PCU9629 stepper motor controller.
- *  The mbed accesses the PCU9629 registers through I2C.
- */
-
-#ifndef        MBED_PCA9629
-#define        MBED_PCA9629
-
-#define     INTELIGENT_WRITE
-
-#define     PCA9629_DEFAULT_ADDR      0x42
-
-#define        INIT_VALUE__MODE          0x10;
-#define        INIT_VALUE__SUBADR1       0xE2;
-#define        INIT_VALUE__SUBADR2       0xE4;
-#define        INIT_VALUE__SUBADR3       0xE8;
-#define        INIT_VALUE__ALLCALLADR    0xE0;
-#define        INIT_VALUE__WDTOI         0xFF;
-#define        INIT_VALUE__WDTCNTL       0x00;
-#define        INIT_VALUE__IP            0x00;
-#define        INIT_VALUE__INTSTAT       0x00;
-#define        INIT_VALUE__OP            0x0F;
-#define        INIT_VALUE__IOC           0x03;
-#define        INIT_VALUE__MSK           0x0F;
-#define        INIT_VALUE__CLRINT        0x0C;
-#define        INIT_VALUE__INTMODE       0x00;
-#define        INIT_VALUE__INT_ACT_SETUP 0x00;
-#define        INIT_VALUE__INT_MTR_SETUP 0x00;
-#define        INIT_VALUE__INT_ES_SETUP  0x00;
-#define        INIT_VALUE__INT_AUTO_CLR  0x00;
-#define        INIT_VALUE__SETMODE       0x00;
-#define        INIT_VALUE__PHCNTL        0x00;
-#define        INIT_VALUE__SROTNL        0x30;
-#define        INIT_VALUE__SROTNH        0x00;
-#define        INIT_VALUE__CWPWL         0x00;
-#define        INIT_VALUE__CWPWH         0x00;
-#define        INIT_VALUE__CCWPWL        0x00;
-#define        INIT_VALUE__CCWPWH        0x00;
-#define        INIT_VALUE__CWSCOUNTL     0x00;
-#define        INIT_VALUE__CWSCOUNTH     0x00;
-#define        INIT_VALUE__CCWSCOUNTL    0x00;
-#define        INIT_VALUE__CCWSCOUNTH    0x00;
-#define        INIT_VALUE__CWRCOUNTL     0x00;
-#define        INIT_VALUE__CWRCOUNTH     0x00;
-#define        INIT_VALUE__CCWRCOUNTL    0x00;
-#define        INIT_VALUE__CCWRCOUNTH    0x00;
-#define        INIT_VALUE__EXTRASTEPS0   0x00;
-#define        INIT_VALUE__EXTRASTEPS1   0x00;
-#define        INIT_VALUE__RAMPCNTL      0x00;
-#define        INIT_VALUE__LOOPDLY       0x00;
-#define        INIT_VALUE__MCNTL         0x00;
-
-
-/** PCA9629 class
- *
- */
- 
-class PCA9629 {
-public:
-
-    /** name of registers */
-    typedef enum {
-        MODE,            /**< Mode rgister */
-        SUBADR1,         /**< I2C-bus subaddress 1 */
-        SUBADR2,         /**< I2C-bus subaddress 2 */
-        SUBADR3,         /**< I2C-bus subaddress 3 */
-        ALLCALLADR,      /**< All call I2C-bus address */
-        WDTOI,           /**< Watchdog time-out interval register */
-        WDTCNTL,         /**< Watchdog control register */
-        IP,              /**< Input port register */
-        INTSTAT,         /**< Interrupt status register */
-        OP,              /**< Output port register */
-        IOC,             /**< I/O configuration register */
-        MSK,             /**< Mask interrupt register */
-        CLRINT,          /**< Clear Interrupts */
-        INTMODE,         /**< Interrupt mode register */
-        INT_ACT_SETUP,   /**< Interrupt action setup control register */
-        INT_MTR_SETUP,   /**< Interrupt motor setup control register */
-        INT_ES_SETUP,    /**< Interrupt extra steps setup control register */
-        INT_AUTO_CLR,    /**< Interrupt auto clear control register */
-        SETMODE,         /**< Output state on STOP */
-        PHCNTL,          /**< Phase control register */
-        SROTNL,          /**< Steps per rotation low byte */
-        SROTNH,          /**< Steps per rotation high byte  */
-        CWPWL,           /**< Step pulse width for CW rotation low byte */
-        CWPWH,           /**< Step pulse width for CW rotation high byte */
-        CCWPWL,          /**< Step pulse width for CCW rotation low byte */
-        CCWPWH,          /**< Step pulse width for CCW rotation high byte */
-        CWSCOUNTL,       /**< Number of steps CW low byte */
-        CWSCOUNTH,       /**< Number of steps CW high byte */
-        CCWSCOUNTL,      /**< Number of steps CCW low byte */
-        CCWSCOUNTH,      /**< Number of steps CCW high byte */
-        CWRCOUNTL,       /**< Number of rotatations CW low byte */
-        CWRCOUNTH,       /**< Number of rotatations CW high byte */
-        CCWRCOUNTL,      /**< Number of rotatations CCW low byte */
-        CCWRCOUNTH,      /**< Number of rotatations CCW high byte */
-        EXTRASTEPS0,     /**< Count value for extra steps or rotations for INTP0 */
-        EXTRASTEPS1,     /**< Count value for extra steps or rotations for INTP1 */
-        RAMPCNTL,        /**< Ramp control register */
-        LOOPDLY,         /**< Loopdelay time register */
-        MCNTL,           /**< Control start/stop motor */
-    } RegisterName;
-
-    /** register names to make 2 bytes access */
-    typedef enum {
-        SROTN_      = SROTNL     | 0x80,    /**< Steps per rotation */
-        CWPW_       = CWPWL      | 0x80,    /**< Step pulse width for CW rotation */
-        CCWPW_      = CCWPWL     | 0x80,    /**< Step pulse width for CCW rotation */
-        CWSCOUNT_   = CWSCOUNTL  | 0x80,    /**< Number of steps CW */
-        CCWSCOUNT_  = CCWSCOUNTL | 0x80,    /**< Number of steps CCW */
-        CWRCOUNT_   = CWRCOUNTL  | 0x80,    /**< Number of rotatations CW */
-        CCWRCOUNT_  = CCWRCOUNTL | 0x80,    /**< Number of rotatations CCW */
-        STEPS_PER_ROATION   = SROTN_,
-        CW__STEP_WIDTH      = CWPW_,
-        CCW_STEP_WIDTH      = CCWPW_,
-        CW__STEP_COUNT      = CWSCOUNT_,
-        CCW_STEP_COUNT      = CCWSCOUNT_,
-        CW__ROTATION_COUNT  = CWRCOUNT_,
-        CCW_ROTATION_COUNT  = CCWRCOUNT_
-    } Register16bits;
-
-    /** keyword to select direction of rotation */
-    typedef enum {
-        CW      = 0,    /**< Clockwise direction */
-        CCW             /**< ConterClockwise direction */
-    } Direction;
-
-    /** plescaler range setting */
-    typedef enum {
-        PRESCALER_FROM_40_TO_333333,    /**< Prescaler range from   3us(333333pps) to   24.576ms(40   pps) */
-        PRESCALER_FROM_20_TO_166667,    /**< Prescaler range from   6us(166667pps) to   49.152ms(20   pps) */
-        PRESCALER_FROM_10_TO_83333,     /**< Prescaler range from  12us( 83333pps) to   98.304ms(10   pps) */
-        PRESCALER_FROM_5_TO_41667,      /**< Prescaler range from  24us( 41667pps) to  196.608ms( 5   pps) */
-        PRESCALER_FROM_2_5_TO_20833,    /**< Prescaler range from  48us( 20833pps) to  393.216ms( 2.5 pps) */
-        PRESCALER_FROM_1_27_TO_10416,   /**< Prescaler range from  96us( 10416pps) to  786.432ms( 1.27pps) */
-        PRESCALER_FROM_0_64_TO_5208,    /**< Prescaler range from 192us(  5208pps) to 1572.864ms( 0.64pps) */
-        PRESCALER_FROM_0_32_TO_2604,    /**< Prescaler range from 384us(  2604pps) to 3145.728ms( 0.32pps) */
-    } PrescalerRange;
-
-    /** Create a PCA9629 instance connected to specified I2C pins with specified address
-     *
-     * @param I2C_sda I2C-bus SDA pin
-     * @param I2C_scl I2C-bus SCL pin
-     * @param I2C_address I2C-bus address (default: 0x42)
-     */
-    PCA9629(
-        PinName I2C_sda,
-        PinName I2C_scl,
-        char    I2C_address = PCA9629_DEFAULT_ADDR
-    );
-
-    /** Initialize all registers
-     *
-     *  The initializing values are defined in the function
-     */
-    void init_registers( void );
-
-    /** Initialize all registers
-     *
-     *  The initializing values are defined in the function
-     */
-    void set_all_registers( char *a, char size );
-    
-    /** Write 1 byte data into a register
-     *
-     *  Setting 8 bits data into a register
-     *
-     *  @param register_name the register name: data writing into
-     *  @param value 8 bits writing data
-     */
-    void write( RegisterName register_name, char value );
-
-    /** Write 2 bytes data into a register
-     *
-     *  Setting 16 bits data into registers
-     *
-     *  @param register_name the register name: data writing into (it can be "SROTN_", "CWPW_", "CCWPW_", "CWRCOUNT_", "CCWSCOUNT_", "CWRCOUNT_" or "CCWRCOUNT_" )
-     *  @param value 16 bits writing data
-     */
-    void write( Register16bits register_name, short value );
-
-    /** Read 1 byte data from a register
-     *
-     *  Setting data into a register
-     *
-     *  @param register_name the register name: data reading from
-     *  @return read 8 bits data from the register
-     */
-    char read( RegisterName register_name );
-
-    /** Read 2 byte data from registers
-     *
-     *  Setting data into a register
-     *
-     *  @param register_name the register name: data writing into (it can be "SROTN_", "CWPW_", "CCWPW_", "CWRCOUNT_", "CCWSCOUNT_", "CWRCOUNT_" or "CCWRCOUNT_" )
-     *  @return read 16 bits data from the registers
-     */
-    short read( Register16bits register_name );
-
-    /** Motor start
-     *
-     *  Start command
-     *  This function starts motor operation with hard-stop flag and rotation+step enabled, no repeat will be performed
-     *  If custom start is required, use "write( PCA9629::MCNTL, 0xXX  )" to control each bits. 
-     *
-     *  @param dir rotate direction ("CW" or "CCW")
-     */
-    void start( Direction dir );
-    
-    /** Motor stop
-     *
-     *  Stop command
-     *
-     */
-    void stop( void );
-
-    /** Set PPS
-     *
-     *  Setting PulsePerSecond
-     *  This interface can be used to set CWPWx or CCWPWx registers
-     *
-     *  @param dir rotate direction ("CW" or "CCW")
-     *  @param prescaler prescaler setting (for 3 bits setting range from 0 to 0x7. See datasheet)
-     *  @param pps pps defineds pulse width for the motor. The pulse width will be 1/pps
-     *  @return 16 bit data that what set to the CWPWx or CCWPWx registers
-     */
-    short pps( Direction dir, PrescalerRange prescaler, int pps );
-
-    /** Set PPS
-     *
-     *  Setting PulsePerSecond
-     *  This interface can be used to set CWPWx or CCWPWx registers
-     *
-     *  @param dir rotate direction ("CW" or "CCW")
-     *  @param prescaler prescaler setting (for 3 bits setting range from 0 to 0x7. See datasheet)
-     *  @param pps pps defineds pulse width for the motor. The pulse width will be 1/pps
-     *  @return 16 bit data that what set to the CWPWx or CCWPWx registers
-     */
-
-    /** Set rotation count
-     *
-     *  Setting rotation count
-     *  This interfaces CWRCOUNTx, CCWRCOUNTx registers
-     *
-     *  @param dir rotate direction ("CW" or "CCW")
-     *  @param rotations sets number of rotations with 16 bit value
-     */
-    void rotations( Direction dir, int rotations );
-
-    /** Set PPS
-     *
-     *  Setting step count
-     *  This interfaces CWSCOUNTx, CCWSCOUNTx registers
-     *
-     *  @param dir rotate direction ("CW" or "CCW")
-     *  @param steps sets number of steps with 16 bit value
-     */
-    void steps( Direction dir, int pps );
-
-
-    /** Register dump
-     *
-     *  Dumping all register data to serial console
-     *
-     */
-    void register_dump( void );
-
-    /** Register dump
-     *
-     *  Dumping all register data to serial console
-     *
-     */
-    void speed_change( unsigned short pw );
-
-private:
-    I2C     i2c;
-    char    i2c_addr;
-};
-
-#endif  //  MBED_PCA9629
-
--- a/main.cpp	Fri Feb 03 04:05:49 2012 +0000
+++ b/main.cpp	Tue Apr 24 08:19:06 2012 +0000
@@ -1,8 +1,8 @@
 /** A sample/demo code for PCA9629
  *
- *  @author  Tedd OKANO, NXP Semiconductors
+ *  @author  Akifumi (Tedd) OKANO, NXP Semiconductors
  *  @version 1.0
- *  @date    03-Feb-2011
+ *  @date    24-Apr-2011
  *
  *  Released under the MIT License: http://mbed.org/license/mit
  *