SparkFun Forums 

Where electronics enthusiasts find answers.

Topics pertaining to the Arduino Core & software used with the Artemis module and Artemis development boards.
By Levi DeLuke
#226232
I'm trying to access the second I2C port on the Redboard Artemis (using pins 25 and 27) with the Sparkfun example sketches for the LSM9DS1. Any recommendations on how to use an I2C port other than the default for this board? I tried altering couple different locations in the core definitions to avail.

When I compile for the Artemis Nano, which uses the pins 25 and 27 by default, it works as expected.
By paulvha
#226234
The ATP only has one I2C port defined by default.
In the sketch do something like :
Code: Select all
#include "Wire.h" 

#define mySDA D25
#define mySCL D27

TwoWire myWire(mySDA, mySCL);

void setup() {
  // put your setup code here, to run once:

  myWire.begin();
}

void loop() {
  // put your main code here, to run repeatedly:

}
By Levi DeLuke
#226510
Thank you for the suggestion. I'm able to compile and upload with the TwoWire, however am receiving a Mbed OS Fault Handler Message in the serial port when the running the code. Any thoughts on what might be causing this? I appreciate any suggestions, even if it means changing the board definitions for the default pin assignments.
Code: Select all
++ MbedOS Fault Handler ++

FaultType: HardFault

Context:
R0: 0
R1: 3C
R2: 10001480
R3: A3008270
R4: 0
R5: 1
R6: F
R7: 0
R8: 0
R9: 0
R10: 0
R11: 0
R12: 25589
SP   : 10007738
LR   : 1160D
PC   : 1289C
xPSR : 41000000
PSP  : 10007718
MSP  : 1005FF70
CPUID: 410FC241
HFSR : 40000000
MMFSR: 0
BFSR : 82
UFSR : 0
DFSR : 0
AFSR : 0
BFAR : A3008270
Mode : Thread
Priv : Privileged
Stack: PSP

-- MbedOS Fault Handler --



++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x1289C
Error Value: 0x10006738
Current Thread: main Id: 0x10004B28 Entry: 0x248B5 StackSize: 0x1000 StackMem: 0x10006798 SP: 0x10007738 
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=SFE_ARTEMIS_ATP
-- MbedOS Error Info --
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum