Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years ago.
GR-PEACH and low level I2C problems
Hello GR-PEACH team,
Last week, I reported low-level I2C issues with the PEACH. Has anyone taken a look at this?
https://developer.mbed.org/questions/7409/GR-PEACH-I2C-not-completely-working/
Regards,
...kevin
Question relating to:
1 Answer
9 years ago.
Your best bet is probably the mbed github. Or just stick to regular functions, in general a better idea than the low level functions.
Using the "regular functions" is a nice gesture Erik,
However, I have written a few I2C drivers. Sometimes using the more complex functions results in problems with some mbed devices and not others. Also, there are a few devices (i.e the MLX90620) that have a non-standard way of using the I2C bus. Because of these incompatibility issues, I always used the low-level I2C commands when writing drivers. Until GR-PEACH, my drivers have always worked with all other mbed CPUs that I use.
I am unfamiliar with github.
Regards,
...kevin
posted by 27 Apr 2015Non-standard I2C devices can be an issue. But actually the normal ones should be less likely to have differences between devices, since some devices simply are not suitable for the low-level ones (due to I2C peripherals never being intended for that).
Mbed github is here: https://github.com/mbedmicro/mbed
posted by 27 Apr 2015
I found the cause of this issue.
Can you try a tentative library and see if issue would be gone?
How to import the library:
http://developer.mbed.org/teams/Renesas/wiki/GR-PEACH-Getting-Started#build-and-run
If you're using "mbed-src_GR-PEACH_rev_c" but not "mbed lib", delete "mbed-src_GR-PEACH_rev_c".
But import "mbed-src_GR-PEACH_rev_c_I2C" instead.
In case of GR-PEACH, please use program described below.
- In case of read processing:
(1) Add a dummy read after an address transmission. The dummy read is marked (*1).
(2) Specify "false" as argument of i2c.read for "last - 1" byte. The sentence is marked (*2).
I have a rev B board. Is that library updated as well?
posted by Kevin Braun 29 Apr 2015For the rev.B board, it should work by the following procedure.
1. Import "mbed-src_GR-PEACH_rev_c_I2C".
2. Replace your "mbed-src\taregets\hal\TARGET_RENESAS\TARGET_RZ_A1H\PinNames.h" with "http://developer.mbed.org/media/uploads/RyoheiHagimoto/pinnames.h".
3. Recompile it on your environment.
Otherwise, we'll upload an updated rev.B library on the week of May 11th.
posted by Yasu Kutsuma 01 May 2015Thank you Yasu,
I made the changes like you suggest. The only thing I found was that the I2C NACK timeouts take a very long time.
I have not yet tested the low-level I2C routines. Over the past couple of days, I re-wrote my I2C drivers to include using the hi-level I2C commands and they now work on the GR-PEACH. I will try the low level routines later when I get a chance.
posted by Kevin Braun 01 May 2015