Artemis RedBoard - digitalWrite works, analogWrite doesn't

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);

Note: I used pins 6 and 5 on the UNO RedBoard since they were both PWM. I’ve tried 6 and 5 on the Artemis RedBoard too with no luck.

Also of note, the Redboard Artemis Apollo3 example AnalogWrite doesn’t “breathe” the LED. It also does nothing.

What core are you using? You might try 1.2.1 if you can get it to work.

I have the same issue on the board I just ordered. Did this get resolved?

I’m having the same issue using core version 2.0.2. I can’t go back because I’m trying to incorporate BLE also. Any suggestions?

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)

It has now been a month with no response from SparkFun.

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.

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);
  }
}

Thanks! I’ll give that a shot!

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.

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)

Thank you!

oops…sorry, D13 should be pad 6 not 8

Yeah, still no go for the base RedBoard Artemis on 2.0.3. I can call digitalWrite on LED_BUILTIN and blink the LED, but analogWrite on LED_BUILTIN does nothing using the examples.