I have the Op-Amp configured as a voltage follower (inverting input connected to the output and applying the signal to the non-inverting input) but the Op-Amp is not reproducing the signal applied to the non-inverting input at its output. The input signal applied is a 0 to 5V saw tooth wave (2.5V offset) at 1kHz; the output remains at ground; with a slight ripple.
Additional configuration information:
I am addressing I/O ports as memory using the #byte directive with variable names using fast_io
Code:
#use fast_io(a) // Fast IO for port a
This requires you set the port direction register using the Tris command:
Code:
set_tris_a(0b00110010);
The pins associated with the Op-Amp are specified as inputs (1) and not assigned to any variable with the #Byte command:
Code:
#byte lat_a = getenv("SFR:LATA")
// port a #defines
#bit Spare1 = lat_a.0 // Spare Pin Assigned as output for debugging
// a1 OpAmp1 Output; Vr
#bit Disp1 = lat_a.2 // Display LED 1 output; Active Low
#bit Spare2 = lat_a.3 // Spare Pin Assigned as output for debugging
// a4 OpAmp1 + input; Vcap
// a5 OpAmp1 - input; Vr
#bit Disp5 = lat_a.6 // Display LED 5 output; Active Low
#bit Disp4 = lat_a.7 // Display LED 4 output; Active Low
Perhaps using fast I/O with an Op-Amp configuration is the problem. Would appreciate help to figure out why the Op-Amps are not working properly from those with experience working with the internal Op-Amps.
Thanks.
mictel
Joined: 24 May 2014 Posts: 14
Problem Solved
Posted: Fri Jun 27, 2014 10:20 pm
After some experimentation and quality time with the data sheet...
The format of Op-Amp setup is:
setup_opamp1(OPAMP_ENABLED|OPAMP_HIGH_GBWP_MODE);
Note that the option to connect the inverting input to the op-amp output (OPAMP_I_TO_OUTPUT) is in the 16F1789.h header file but no such option exists on the data sheet, subsequently, it does not work. A physical connection must be made between the inverting input pin and the output pin to create a voltage follower.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum