So, I'm wanting to use the UNO as a pulse generator to drive a 1kHz square wave into the input of a High Speed Counter Module on a PLC. The signal will serve as a clock to precisely time 2 valves on a pneumatic cylinder. Does anyone see any limitations? I am simply going to use a digital output and manually turn it on and off with 10% duty cycle and a amplitude of 2.64v. Is there any way to increse the amplitude? The more the better as I tried to create a waveform generator with a 8038 IC and i could only get the amplitude to around 1.7v. Needless to say, the ouput from the HSC was unpredictable. I am an electrical technician/electrician/ programmer by trade so electronics is something that I have eagerly wanted to dive into all my life, just not very knowledgeable yet.
TheDudeAbidess:
So, I'm wanting to use the UNO as a pulse generator to drive a 1kHz square wave into the input of a High Speed Counter Module on a PLC. The signal will serve as a clock to precisely time 2 valves on a pneumatic cylinder. Does anyone see any limitations? I am simply going to use a digital output and manually turn it on and off with 10% duty cycle and a amplitude of 2.64v. Is there any way to increse the amplitude? The more the better as I tried to create a waveform generator with a 8038 IC and i could only get the amplitude to around 1.7v. Needless to say, the ouput from the HSC was unpredictable. I am an electrical technician/electrician/ programmer by trade so electronics is something that I have eagerly wanted to dive into all my life, just not very knowledgeable yet.
What input of the PLC are you driving? It sounds like either you've got a voltage divider effect or an incompatible input on the PLC that's unduly loading the output pin of the Arduino.
You might consider looking at using Timer 1 to generate 1kHz in hardware, with none of the jitter or latency that firmware may give.
const byte pinPWM = 9;
void setup( void )
{
pinMode( pinPWM, OUTPUT );
digitalWrite( pinPWM, LOW );
//TIMER1 setup
//toggle OC1A pin on compare (COM1A1..0 == 01)
//WGM CTC mode (WMG13..0 == 0100)
//
// 1kHz == 1000uS; need to toggle pin every 500uS
// 500uS/62.5uS = 8000 ticks
// Use prescaler == 1 (clkio/1)
TCCR1A = (1<<COM1A0);
TCCR1B = (1<<WGM12) | (1<<CS10);
OCR1A = 8000;
}//setup
void loop( void )
{
}//loop
A+ on a 1746-HSCE. SLC-500. However, I have not wired the arduino into the HSC as of yet. Only the 8038 circuit I built with a 7404N inverter.