CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Sparkfun QWIIC Openlog example.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Rocket



Joined: 29 Aug 2005
Posts: 27

View user's profile Send private message

Sparkfun QWIIC Openlog example.
PostPosted: Mon Jul 29, 2019 12:43 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 29, 2019 2:45 am     Reply with quote

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: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jul 29, 2019 4:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 29, 2019 6:40 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 29, 2019 9:54 am     Reply with quote

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: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jul 29, 2019 1:21 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 29, 2019 8:36 pm     Reply with quote

You didn't tell us, so I did a search. It looks like this is the source code
file that would have to be converted to CCS, so you could send
commands to the Qwiic OpenLog device:
https://github.com/sparkfun/SparkFun_Qwiic_OpenLog_Arduino_Library/blob/master/src/SparkFun_Qwiic_OpenLog_Arduino_Library.cpp
Rocket



Joined: 29 Aug 2005
Posts: 27

View user's profile Send private message

PostPosted: Mon Jul 29, 2019 11:50 pm     Reply with quote

Thanks for all the responses. It is time I learned to code.
_________________
J.I.L.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group