Right, I have finally fixed this problem, so here is the corrected code for anyone who wants to try and get started with this pair of boards using C++. The main error was down in the Case statement where the contents of the address pointer were mistakenly passed to the data out, meaning that a byte of zero was sent first. This code is not very helpful in it's current format, and needs restructuby Jeremy - Serial & I2C Devices
Hi Jimeer; Thanks for the feedback, but so far I'm no closer to resolving the problem... 1) On closer inspection, the BV511 also uses 10k pull-ups, so I actually have 10k on each end of the 15cm cable (5k total on each line) so should be no problem, especially at this speed. 2A) The address I'm using is 0x42 which is passed to the I2C0DAT register on the LPC2132 which is 8 bits (7 plus the dby Jeremy - Serial & I2C Devices
/************************************************************/ /* PROJECT: I2C test platform for LPC2132 */ /************************************************************/ #include <LPC213x.H> #include <stdarg.h> void I2CISR (void) __irq ; //I2C interrupt routine void I2CTransferByte(unsigned int I2CAddr,unsigned char MemAddby Jeremy - Serial & I2C Devices
I'm trying to control a motor using the BV4213, connected to the I2C0 of a BV511. I currently have an LED on each output Y1,2,3,4 to test the setup, which also use the 5V feed from the 511. The whole thing is in C++, and based on the Keil example I2C interface for the LPC210x, although I've modified this to correct the changed register names etc for the LPC213x. I'm programming it in uVision,by Jeremy - Serial & I2C Devices