Girino Pin Connections

Hello, I am working on building the girino digital oscilloscope based on this tutorial: http://www.instructables.com/id/Girino-Fast-Arduino-Oscilloscope/?ALLSTEPS

However, I am having trouble understanding the diagrams and how the circuit is supposed to connect to the Arduino pins (I am using an Arduino Uno). My understanding so far is the same as this person: http://forum.arduino.cc/index.php?topic=149263.msg1196139#msg1196139

Arduino <-> Girino Software (Interrupt) <-> Girino Hardware (schematic diagram)
Analog 0 ADCSRA ADC:1
? ? AnalogComparator:1
? ? Threshold:1
Analog 3 thresholdPin PWM:1 (sent the software threshold to Girino Hardware)
D13 errorPin ( onboard Led )

I do not know how the threshold and analog comparator outputs are supposed to connect to the arduino. No pin is specified in the tutorial and I haven’t been able to find these two pins referenced in the code. I was hoping that either 1. someone here has experience with the Girino and can point me in the right direction or 2. someone with a better understanding of the code can help me find where the analog comparator and threshold pins are referenced.

There are several different files of code in the girino which are too long to paste here but can be downloaded on the instructables page.

All suggestions are appreciated :slight_smile:
Thanks!

Which diagram/step are you stuck at?

I’m stuck at where to actually connect the circuit to the arduino. I have the whole thing built but I can’t figure out which pins the “Threshold” and “AnalogComparator” outputs are supposed to connect to. The code references “thresholdpin” which is the PWM input from pin 3 into the threshold circuit, but not the pin for the output. It also references the ADC output “ADCPin” (pin 0) but not the pin for the Analog Comparator output.

I’ve read through the code looking for references to the analog comparator and threshold pins but haven’t seen anything straightforward.

//-----------------------------------------------------------------------------
// Girino.h
//-----------------------------------------------------------------------------
// Copyright 2012 Cristiano Lino Fontana
//
// This file is part of Girino.
//
//	Girino is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	Girino is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with Girino.  If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------

#include <Arduino.h>

//-----------------------------------------------------------------------------
// Defines and Typedefs
//-----------------------------------------------------------------------------

#define DEBUG		0

#define ADCBUFFERSIZE	1280

#define ADCPIN		0
#define errorPin	13
#define thresholdPin	3

#define BAUDRATE	115200	// Baud rate of UART in bps
#define COMMANDDELAY	10	// ms to wait for the filling of Serial buffer
#define COMBUFFERSIZE	3	// Size of buffer for incoming numbers

#if DEBUG == 1
	#define dprint(expression) Serial.print("# "); Serial.print( #expression ); Serial.print( ": " ); Serial.println( expression )
	#define dshow(expression) Serial.println( expression )
#else
	#define dprint(expression) 
	#define dshow(expression)
#endif

// Defines for setting and clearing register bits
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif

//-----------------------------------------------------------------------------
// Global Constants
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Function Prototypes
//-----------------------------------------------------------------------------
void initPins(void);
void initADC(void);
void initAnalogComparator(void);

void startADC( void );
void stopADC( void );
void startAnalogComparator( void );
void stopAnalogComparator( void );

void setADCPrescaler( uint8_t prescaler );
void setVoltageReference( uint8_t reference );
void setTriggerEvent( uint8_t event );

void error (void);
// Fills the given buffer with bufferSize chars from a Serial object
void fillBuffer( \
	char *buffer, \
	byte bufferSize, \
	HardwareSerial::HardwareSerial* serial = &Serial );
void printStatus(void);

//-----------------------------------------------------------------------------
// Global Variables
//-----------------------------------------------------------------------------
extern volatile  boolean wait;
extern          uint16_t waitDuration;
extern volatile uint16_t stopIndex;
extern volatile uint16_t ADCCounter;
extern volatile  uint8_t ADCBuffer[ADCBUFFERSIZE];
extern volatile  boolean freeze;

extern           uint8_t prescaler;
extern           uint8_t triggerEvent;
extern           uint8_t threshold;

extern              char commandBuffer[COMBUFFERSIZE+1];

I’m stuck at where to actually connect the circuit to the arduino.

There are several circuits on that site. I’ll ask again. Which circuit? Every one of them has a step number.

Oh, sorry, I misunderstood what you were asking. I'm stuck at steps 13 and 18.

It looks to me like the schematics in 13 and 18 come together later on. They do not appear to be standalone circuits that mean anything to the Arduino.