demo sample to drive PCU9955 and PCA9629
Dependencies: mbed I2C_slaves PCU9669 parallel_bus
Fork of mini_board_PCU9669 by
What is this?
This is a sample code to operate PCU9955 (16ch constant-current LED controller) and PCA9629 (intelligent stepper motor controller) through PCU9669 (3 channels (UltraFast mode * 2ch, FastModePlus *1ch) I2C bus controller).
This demo is written based on mini_board_PCU9669 sample code library and its API.
http://mbed.org/users/nxp_ip/code/mini_board_PCU9669/
Demo will shows how the LED controllers and stepper motor controllers works.
It uses a mini_board_PCU9669 board with mbed, 8 of PCU9955s and 5 PCA9629s.
Demo setup
(left-top: PCU9955 boards, left-bottom: mini-board PCU9669 with mbed, right: PCA9629 x5 board)
Board connections and device addresses
Reference:
User manual of PCU9669 demo board: Mini board PCU9669
http://www.nxp.com/documents/user_manual/UM10580.pdf
sample code : mbed programs
Import programmini_board_PCU9669
mini board PCU9669 (and PCA9665) sample code
Import programPCA9955_Hello
PCA9955 16 channel current drive(sink) LED driver sample code
Import programPCA9955_simple
very simple sample code for PCA9955 (16 channel current control LED driver)
Import programPCA9629_Hello
Sample code for PCA9629 operation
device infomation
PCU9669 (Parallel bus to 1 channel Fm+ and 2 channel UFm I2C-bus controller)
PCU9955 (16-channel UFm I²C-bus 57 mA constant current LED driver)
PCA9955 (16-channel Fm+ I²C-bus 57 mA constant current LED driver)
PCU9629 (Fm+ I2C-bus stepper motor controller)
PCA9629_reg.h@20:a266fa588bd8, 2012-10-26 (annotated)
- Committer:
- nxp_ip
- Date:
- Fri Oct 26 05:59:55 2012 +0000
- Revision:
- 20:a266fa588bd8
demo code ported on latest library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nxp_ip | 20:a266fa588bd8 | 1 | /* A sample code for PCU9669 (and its family) operation sample |
nxp_ip | 20:a266fa588bd8 | 2 | * |
nxp_ip | 20:a266fa588bd8 | 3 | * @author Tedd OKANO, NXP Semiconductors |
nxp_ip | 20:a266fa588bd8 | 4 | * @version 0.5 |
nxp_ip | 20:a266fa588bd8 | 5 | * @date 13-Oct-2011 |
nxp_ip | 20:a266fa588bd8 | 6 | * |
nxp_ip | 20:a266fa588bd8 | 7 | * Released under the MIT License: http://mbed.org/license/mit |
nxp_ip | 20:a266fa588bd8 | 8 | * |
nxp_ip | 20:a266fa588bd8 | 9 | * An operation sample of PCU9669 I2C bus controller. |
nxp_ip | 20:a266fa588bd8 | 10 | * The mbed accesses the PCU9669's parallel port (8 bit address and 8 bit data) using bit-banging. |
nxp_ip | 20:a266fa588bd8 | 11 | * The bit-banging is poerformed by PortInOut function of mbed library. |
nxp_ip | 20:a266fa588bd8 | 12 | * |
nxp_ip | 20:a266fa588bd8 | 13 | * To make the code porting easier, all codes are partitioned into layers to abstract other parts. |
nxp_ip | 20:a266fa588bd8 | 14 | * The mbed specific parts are concentrated in lowest layer: "hardware_abs.*". |
nxp_ip | 20:a266fa588bd8 | 15 | * This module may need to be modified when porting. |
nxp_ip | 20:a266fa588bd8 | 16 | * |
nxp_ip | 20:a266fa588bd8 | 17 | * All other upper layers are writen in standard-C. |
nxp_ip | 20:a266fa588bd8 | 18 | * |
nxp_ip | 20:a266fa588bd8 | 19 | * base code is written from 05-Sep-2011 to 09-Sep-2011. |
nxp_ip | 20:a266fa588bd8 | 20 | * And demo code has been build on 11-Sep-2011. |
nxp_ip | 20:a266fa588bd8 | 21 | * Debug and code adjustment has been done on 08-Sep-2011. |
nxp_ip | 20:a266fa588bd8 | 22 | * Small sanitization for main.cpp. All mbed related codes are moved in to "hardware_abs.*". 13-Oct-2011 |
nxp_ip | 20:a266fa588bd8 | 23 | */ |
nxp_ip | 20:a266fa588bd8 | 24 | |
nxp_ip | 20:a266fa588bd8 | 25 | /** PCA9629 related definitions |
nxp_ip | 20:a266fa588bd8 | 26 | * |
nxp_ip | 20:a266fa588bd8 | 27 | * This header file was intended to define the PCA9629 registers but those details are not required in this application. |
nxp_ip | 20:a266fa588bd8 | 28 | * So this file only have I2C addresses definitions |
nxp_ip | 20:a266fa588bd8 | 29 | */ |
nxp_ip | 20:a266fa588bd8 | 30 | |
nxp_ip | 20:a266fa588bd8 | 31 | #ifndef __PCA9629_REG__ |
nxp_ip | 20:a266fa588bd8 | 32 | #define __PCA9629_REG__ |
nxp_ip | 20:a266fa588bd8 | 33 | |
nxp_ip | 20:a266fa588bd8 | 34 | /** @var PCA9629 I2C bus addresses |
nxp_ip | 20:a266fa588bd8 | 35 | */ |
nxp_ip | 20:a266fa588bd8 | 36 | |
nxp_ip | 20:a266fa588bd8 | 37 | typedef enum { |
nxp_ip | 20:a266fa588bd8 | 38 | MOT_ADDR0 = 0x40, |
nxp_ip | 20:a266fa588bd8 | 39 | MOT_ADDR1 = 0x42, |
nxp_ip | 20:a266fa588bd8 | 40 | MOT_ADDR2 = 0x44, |
nxp_ip | 20:a266fa588bd8 | 41 | MOT_ADDR3 = 0x46, |
nxp_ip | 20:a266fa588bd8 | 42 | MOT_ADDR4 = 0x48, |
nxp_ip | 20:a266fa588bd8 | 43 | MOT_ADDR5 = 0x4A, |
nxp_ip | 20:a266fa588bd8 | 44 | MOT_ADDR6 = 0x4C, |
nxp_ip | 20:a266fa588bd8 | 45 | MOT_ADDR7 = 0x4E, |
nxp_ip | 20:a266fa588bd8 | 46 | MOT_ADDR8 = 0x50, |
nxp_ip | 20:a266fa588bd8 | 47 | MOT_ADDR9 = 0x52 |
nxp_ip | 20:a266fa588bd8 | 48 | } |
nxp_ip | 20:a266fa588bd8 | 49 | pca9629_addr; |
nxp_ip | 20:a266fa588bd8 | 50 | |
nxp_ip | 20:a266fa588bd8 | 51 | |
nxp_ip | 20:a266fa588bd8 | 52 | #endif // __PCA9629_REG__ |