View previous topic :: View next topic |
Author |
Message |
Rocket
Joined: 29 Aug 2005 Posts: 27
|
Sparkfun QWIIC Openlog example. |
Posted: Mon Jul 29, 2019 12:43 am |
|
|
Hi, noob question here. I would like to use the I2C openlog device from Sparkfun. I have been unable to port the code from arduino to ccs. If someone could point me in the right direction I would be very grateful. Thank you. _________________ J.I.L. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 29, 2019 2:45 am |
|
|
I assume you actually mean the SparkFun Qwiic OpenLog.
https://www.sparkfun.com/products/15164
This board uses an AtMega328 microcontroller. This is not a PIC.
The product has a bootloader for application code. It runs Arduino code,
compiled with the Arduino compiler. You can't compile CCS code, which
runs on PICs, and download it to an Arduino AtMega328 and expect it to
work. It won't. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Mon Jul 29, 2019 4:57 am |
|
|
Yeesh, I'm confused (only 1 coffee so far...)
I read (OK, scanned ) the 'datasheet' and I thought it was just an IIC version of the logger, though it has the 'option' to download a program into it, presumably to make a 'smart' I2C peripheral...
I did see it's a 3 volt device.
If it IS like it's 'cousin', then one could just convert Ardunio code into PIC C to use it.
I need more coffee...
Jay |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Mon Jul 29, 2019 6:40 am |
|
|
I think he just wants code to write data via i2c to the logger, not re write the procesor code.
Sparkfun provides a manual with the commands.
You need to write the driver.
Ccs provides standard i2c functions.
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
Rocket
Joined: 29 Aug 2005 Posts: 27
|
|
Posted: Mon Jul 29, 2019 9:54 am |
|
|
Gabriel, you are correct, I am wanting to write to the logger.
Something like printf(Logger,"Hello World"); would be great. _________________ J.I.L. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Mon Jul 29, 2019 1:21 pm |
|
|
Since I don't have one of those modules, I can't cut code for a 'driver' or 'library' as I can't test it.
You can take the Ardunio library and convert into CCS C though. A bit of a challenge, but you would be a much better programmer in the end !
Remember that module is 3 volts, so you cannot directly wire it to a 5 volt PIC ! Either choose a PIC that will run ( at desired clock speed) on 3 volts or add appropriate 'logic level conversion' module.
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Rocket
Joined: 29 Aug 2005 Posts: 27
|
|
Posted: Mon Jul 29, 2019 11:50 pm |
|
|
Thanks for all the responses. It is time I learned to code. _________________ J.I.L. |
|
|
|