The speed of voltage changes in DAC output is dependent on code complexity, I'm seeing DAC output speeds high as 27,414/sec using the Uno, and 4,023/sec using the Arduino 101 with a test code that simply flips between high and low with no delays. Need to get a scope someday soon (I hope).Īfter reviewing Adafruit's MCP4725 sketches further, I realized today that communications with and output from the DAC are much faster than previously thought. Unfortunately, I was unable to find a signal to measure frequency at the SDA and SCL pins with my DMM. In any case, fast and slow doesn't change performance of Adafruit's MCP4725 sketches, not a bit. I don't know enough C and C++ to know why. These errors went away when I changed to twowire.begin, which I noticed was more obviously defined in the library code. 'wire' was not declared in this scope, and Once the modified i2c and wire libs were compiling, I tried replacing TWBR references with wire.begin() and wire.begin(fast) in Adafruit's library for the MCP4725 DAC breakout. Second, with your help, I located the library recoding problem: i2c.c line 102 needed to change from i2c_openadapter(void) to int i2c_openadapter(bool i2c_speed). Ret = wait_dev_ready(I2C_SENSING_0, false) įirst, I hadn't noticed IDE's compile window scroll-up feature. Memset(&i2c_cfg, 0, sizeof(i2c_cfg_data_t)) SET_PIN_MODE(25, I2C_MUX_MODE) // Txd SOC PIN (Arduino header pin 19) SET_PIN_MODE(24, I2C_MUX_MODE) // Rdx SOC PIN (Arduino header pin 18) In i2c.c the openadapter function should read: int i2c_openadapter(bool i2c_speed) In i2c.h the openadapter line should be: int i2c_openadapter(bool i2c_speed) Init_status = i2c_openadapter(i2c_speed) In wire.cpp it should read for the functions: void TwoWire::begin() In wire.h you should have the following two lines for wire.begin(): void begin() If you scroll up in the compile window there should be a more detailed message on where the error is, I hope. Just checked and the changes look correct.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |