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)
Diff: PCx9955_reg.h
- Revision:
- 20:a266fa588bd8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCx9955_reg.h Fri Oct 26 05:59:55 2012 +0000 @@ -0,0 +1,122 @@ +/* A sample code for PCU9669 (and its family) operation sample + * + * @author Tedd OKANO, NXP Semiconductors + * @version 0.5 + * @date 13-Oct-2011 + * + * Released under the MIT License: http://mbed.org/license/mit + * + * An operation sample of PCU9669 I2C bus controller. + * The mbed accesses the PCU9669's parallel port (8 bit address and 8 bit data) using bit-banging. + * The bit-banging is poerformed by PortInOut function of mbed library. + * + * To make the code porting easier, all codes are partitioned into layers to abstract other parts. + * The mbed specific parts are concentrated in lowest layer: "hardware_abs.*". + * This module may need to be modified when porting. + * + * All other upper layers are writen in standard-C. + * + * base code is written from 05-Sep-2011 to 09-Sep-2011. + * And demo code has been build on 11-Sep-2011. + * Debug and code adjustment has been done on 08-Sep-2011. + * Small sanitization for main.cpp. All mbed related codes are moved in to "hardware_abs.*". 13-Oct-2011 + */ + +/** PCx9955 (PCU9955 and PCA9955) related definitions + * + * PCx9955's internal register name and address definitions, I2C address difinitions + */ + +#ifndef __PCx9955_REG__ +#define __PCx9955_REG__ + +/** @var Register names + * + * PCx9955 internal register name and addesses + */ +typedef enum { + MODE1 = 0x00, + MODE2, + LEDOUT0, + LEDOUT1, + LEDOUT2, + LEDOUT3, + GRPPWM = 0x08, + GRPFREQ, + PWM0 = 0x0A, + PWM1, + PWM2, + PWM3, + PWM4, + PWM5, + PWM6, + PWM7, + PWM8, + PWM9, + PWM10, + PWM11, + PWM12, + PWM13, + PWM14, + PWM15, + IREF0 = 0x22, + IREF1, + IREF2, + IREF3, + IREF4, + IREF5, + IREF6, + IREF7, + IREF8, + IREF9, + IREF10, + IREF11, + IREF12, + IREF13, + IREF14, + IREF15, + OFFSET = 0x3A, + SUBADR1, + SUBADR2, + SUBADR3, + ALLCALLADR, + RESERVED1, + RESERVED2, + RESERVED3, + PWMALL, + IREFALL, + EFLAG0, + EFLAG1, + + REGISTER_START = MODE1, + LEDOUT_REGISTER_START = LEDOUT0, + PWM_REGISTER_START = PWM0, + IREF_REGISTER_START = IREF0, +} +command_reg; + +/** @var PCx9955 I2C bus addresses + */ +typedef enum { + PCx9955_ADDR0 = 0xC0, + PCx9955_ADDR1 = 0xC2, + PCx9955_ADDR2 = 0xC4, + PCx9955_ADDR3 = 0xC6, + PCx9955_ADDR4 = 0xC8, + PCx9955_ADDR5 = 0xCA, + PCx9955_ADDR6 = 0xCC, + PCx9955_ADDR7 = 0xCE, + PCx9955_ADDR8 = 0xD0, + PCx9955_ADDR9 = 0xD2, + PCx9955_ADDRA = 0xD4, + PCx9955_ADDRB = 0xD6, + PCx9955_ADDRC = 0xD0, + PCx9955_ADDRD = 0xD2, + PCx9955_ADDRE = 0xD4, + PCx9955_ADDRF = 0xD6 +} +pcx9955_addr; + + + +#endif // __PCx9955_REG__ \ No newline at end of file