PDA

View Full Version : [Question(s)] openlog with openCM9.04 for dynamixel motor.



sinhuifasola
12-30-2016, 01:30 AM
Basically I need to use openlog (https://www.sparkfun.com/products/13712) in openCM9.04(http://www.trossenrobotics.com/open-cm-904c) . Openlog is a datalogger that stored the information in the SD card. After read up some posts, I notice I need to insert “SD.h” library in the program. It is a library for SD card work with Arduino. The openCM9.04 package didn’t come with the SD.h , so I download it from Arduino.


But I encounter some issue, that is the reason I email you few days ago. After some troubleshooting, I notice I need to change the “Arduino.h” to “Pandora.h” to suit the OpenCM9.04. Besides that, the arrangement of library is different as the OpenCM9.04 using older Arduino IDE version, while the source file I downloaded is in the latest version of Arduino. However, I think I manage to solve these two issues as the errors didn’t appear.

But the problem that I encounter now is my error start to recognize the SPI pin (SS, SCK,MISO,MOSI). It not able to recognized the terms. After some troubleshooting, I found out the “Arduino.h” include “avr” directory (The AVR language is a "C" environment for programming Atmel chips), while the OpenCM9.04’s “Pandora.h” don’t have the avr directory. So far, I have modified these few SPI number (SS-pin 0; SCK- pin 1; MISO-pin 6; MOSI-pin 7) in “Sd2Card.h” in the utility library and some other troubleshooting. But the problem still insist, hence I suspect that might be the reasons for the error.
Any people that have similar experience on this? Thanks you so much!https://forum.pjrc.com/images/smilies/wink.png

jwatte
01-02-2017, 03:36 AM
Yes the SPI peripheral on the AVR based Arduino boards is different from the SPI peripheral on the OpenCM board.
I would not expect AVR-based libraries to work on the OpenCM as a general case -- the microcontrollers are very different.

There are a few libraries out there that can read/write SD cards using the STMicro ARM chip that's on the OpenCM.
For example, a Google search found this:
https://stm32f4-discovery.net/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/
That's based on a slightly newer variant of the chip (F4 instead of F103 if I recall correctly) but it may be possible to adapt.

sinhuifasola
01-03-2017, 01:07 AM
Yes the SPI peripheral on the AVR based Arduino boards is different from the SPI peripheral on the OpenCM board.
I would not expect AVR-based libraries to work on the OpenCM as a general case -- the microcontrollers are very different.

There are a few libraries out there that can read/write SD cards using the STMicro ARM chip that's on the OpenCM.
For example, a Google search found this:
https://stm32f4-discovery.net/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/
That's based on a slightly newer variant of the chip (F4 instead of F103 if I recall correctly) but it may be possible to adapt.


hi
thanks you so much! it really help me alot! i would try to figure out with the reference link that you give me! thanks so much.