SparkFun Forums 

Where electronics enthusiasts find answers.

Topics pertaining to the Arduino Core & software used with the Artemis module and Artemis development boards.
User avatar
By fordfanboi
#221200
The following digital calls work, but the analog calls don't. The voltage on the pin remains 0v with the analog calls. Do I need to configure the pins more than I've shown below? TY

Works:
digitalWrite(9, HIGH);
digitalWrite(8, LOW);

The following doesn't work (but does work on an UNO RedBoard):
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);

analogWrite(9, 255);
analogWrite(8, 0);
By paulvha
#221851
what BLE communication do you need? I have ported the BLE from 1.xx to 1.2.X. I am still puzzled why that has been removed. I have instruction to install the exactle-BLE stack (these days known as Cordio) to the 1.2.1 to receive and sent data. I have the limits (as I wanted to keep it very simple) are MAX 20 bytes and no handshake (scaled down version of AMDTP.. but then MUCH easier)
#222088
I am NOT Sparkfun, but trying to help. There a number of pads that can be used for Analogwrite (which is actually turned to PWM output). Pins 8 and 9 are not part of that. Look at the Apollo3 datasheet, table 585. All those with CTx are able to be used. Just to point the PAD out here.: 12,25,13,26,18,27,19,28,5,29,6,30,22,31,23,32,42,4,43,7,44,24,45,33,46,39,47,35,48,37,49,11

I have used an ATP board and used the following example with a led + 1K.
Code: Select all
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);

  Serial.println("starting\n");
  
  pinMode(29, OUTPUT);
  analogWrite(29, 0);
}

void loop() {
  uint8_t i;
  for (i = 0 ; i < 255 ; i++){
    delay(10);
    analogWrite(29, i);
  }

  for (; i > 0 ; i--){
    delay(10);
    analogWrite(29, i);
  }
}
#222090
I am able to get the Arduino built-in example under the analog heading called Fading (Examples\Analog\Fading) to work on my Artemis Nano, but the example from the Apollo3/AnalogWrite does not work. I am using LED_BUILTIN as the pin callout for both programs.
#222100
For the artemis redboard nano and core 2.0.3 you must change two files in the core:

* *******************************************************************************************
* To get Serial.print to work you need to:
*
* Variant = core directory + SparkFun/hardware/apollo3/2.03/variants/SFE_ARTEMIS_NANO
* ** Variant/variant.cpp: Needs to comment line = //UART Serial1(SERIAL1_TX, SERIAL1_RX);
* *******************************************************************************************
* *******************************************************************************************
* ** Variant/config/pins.cpp: Needs to be changed to to get anolog and digitalWrite to work
* *******************************************************************************************

#include "bridge/pins.h"

const pin_size_t variantPinCount = 18;

PinState variantPinStates[variantPinCount] = {
{A0, 13, NULL, NULL},
{A1, 33, NULL, NULL},
{A2, 11, NULL, NULL},
{A3, 29, NULL, NULL},
{D4, 18, NULL, NULL},
{A5, 31, NULL, NULL},
{D6, 43, NULL, NULL},
{D7, 42, NULL, NULL},
{D8, 38, NULL, NULL},
{D9, 39, NULL, NULL},
{D10, 40, NULL, NULL},
{D11, 5, NULL, NULL},
{D12, 7, NULL, NULL},
{D13, 8, NULL, NULL},
{A14, 35, NULL, NULL},
{A15, 32, NULL, NULL},
{A16, 12, NULL, NULL},
{LED1, 19, NULL, NULL},
};


Pins need to be referred to as D12 (not just 12) or A14 in your code.
pwm (analogWrite) works A0,A1,A2,A3,D4,A5,D6,D7,D8=NO,D9,D10=NO,D11,D12
,D13=NO,A14,A15,A16
digitalWrite works on all pins but may be a problem around D10-D14
(haven't had time to verify digitalWrite yet)
#
 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