Pin assignments Pro-Micro vs. UNO

Hello all!

I bought a Pro-Micro 5V and it works fine. I’ve tried a few different sketches and even connected output to a processing sketch. I got curious about an arduino oscilloscope to look at signals and found a project that uses an UNO while I have a Pro Micro/Leonardo. Here’s the link to the project I refer: https://www.instructables.com/Oscillosc … rocessing/

In that link is a link to the arduino code. I’ve looked at it and the first example uses four pins; ~10,A0, ~9,A1

~10 connected to A0 and ~9 connected to A1 is marked on an UNO. When I look at the Sparkfun hookup guide for the Pro-Micro file:///media/fuse/crostini_d114572d6563ee5f9eb2c06fe3a3c1dec2d5fd6a_termina_penguin/Arduino/ProMicro&Fio_v3_HookupGuide_Web.pdf on page 3, I see it also has A0,A1,A2,A3 but then I don’t see ~10 or a ~9.

I tried just hooking up 10 to A0 and 9 to A1 on the Pro Micro but the BegOscopio V1.3 doesn’t see the output. I can connect serial which is good, but no oscilloscope output.

Here’s the direct links to the arduino code and processing code:

Arduino code: https://github.com/rogeriobego/oscillos … rduino.zip

Processing code: https://github.com/rogeriobego/oscillos … source.zip

How do I translate/convert ~10 and ~9 to pins on the Pro Micro?

Oh, here’s code snippet(lines 88 thru 135) that shows some pins:

//--------------- Ler Resistor/Capacitor ---------
boolean lerRC=false;
#define pinV 5
#define pinA 7 // pino A 10 multiplex 
#define pinB 8 // pino B 9 multiplex
byte entrada=0;
int vi, vf, v;
//float rx=0, cx=0;
//float r[]={0.0,200.0,20000.0,1000000.0};
//float re[]={0.0,145.2,20692.9,1017847.5};
//float vcc[]={0,871.5,1026.3,1027.1};
unsigned long dtRC=0;
char unidadeRC=' ';
boolean debug=true;

void setup() {

 //---------- configura o preescaler do ADC ======
 ADCSRA &= ~PS_128;  //limpa configuração da biblioteca do arduino
 
 // valores possiveis de prescaler só deixar a linha com prescaler desejado
 // PS_16, PS_32, PS_64 or PS_128
 //ADCSRA |= PS_128; // 64 prescaler
 //   ADCSRA |= PS_64; // 64 prescaler
 //  ADCSRA |= PS_32; // 32 prescaler
  ADCSRA |= PS_16; // 16 prescaler
//=================================================
  
  //definir Timer1 pwm(pino9) e pino10 para monitorar freq
  pinMode(10,OUTPUT);
  //vou inicializar com 10Hz (100ms=100000us)
  Timer1.initialize(pwmP); //100000us=100ms=>10Hz
  Timer1.pwm(9,map(pwmPon,0,100,0,1023)); //pwm no pino9 com 25% duty cycle
  Timer1.attachInterrupt(callback); //attaches callback() como timer overflow interrupt
  //Timer1.stop();

  //inicializar A0, A1, A2, A3 com pull_up
  // não ficou bom pois qdo não tem nada conectado na porta, ela fica
  // com 5v. O melhor é colocar um pull_down com resistor
  //  A0___|R=20k|___GND
  //     |__ Vinput
  /*
   * pinMode(A0,INPUT_PULLUP);
   * pinMode(A1,INPUT_PULLUP);
   * pinMode(A2,INPUT_PULLUP);
   * pinMode(A3,INPUT_PULLUP);
  */

The A10 and A9 pins on the Arduino Micro can be seen at https://www.arduino.cc/en/uploads/Main/ … inout3.png

OMG, I got it to work. I changed the pin assignments and carefully followed the directions in the project link for displaying a signal and it worked.

Here is what I changed:

//--------------- Ler Resistor/Capacitor ---------
boolean lerRC=false;
#define pinV 5
#define pinA 9 /////7 // pino A 10 multiplex 
#define pinB 10 /////8 // pino B 9 multiplex
byte entrada=0;

Then I changed this, but I think it needs something because I only see output on ch0

  //definir Timer1 pwm(pino9) e pino10 para monitorar freq
  pinMode(18,OUTPUT); //(10,OUTPUT);
  //vou inicializar com 10Hz (100ms=100000us)
  Timer1.initialize(pwmP); //100000us=100ms=>10Hz
  Timer1.pwm(19,map(pwmPon,0,100,0,1023)); //(9,map(pwmPon,0,100,0,1023)); //pwm no pino9 com 25% duty cycle
  Timer1.attachInterrupt(callback); //attaches callback() como timer overflow interrupt
  //Timer1.stop();

I got it working pretty good now. Just out of curiosity, I connected the Tx line of a GPS to see what it looks like and it is a group of square waves that moves across the screen. It doesn’t seem to have a lot of adjustments, so I couldn’t get it to stay in one spot on the screen. It’s still cool that it works at all.

Hmmm, this is turning out to be useful too. I have some old dusty RC radio stuff and one piece is a Rx and PPM sum board that I built. I built it so that I could use one connection on a flight controller for radio. I never fully understood what it did and this little pro-micro oscilloscopio exercise showed me. I hooked up the PPM out signal line to A2 on the pro micro and played with the time scale and voltage scale until I had 7 pulses nice and steady on the screen. I got out the Tx and turned it on and played with the sticks. The position of the pulses changes while the pulses don’t. I measured full stick and saw max distance was about 1900 ms and mid stick was 1500 ms - that makes sense. So, PPM means pulse position modulation. Cool.