Digital gain control of Opamp.

The gain of U1 can be controlled by a digital binary 1248 nibble at ABC. The gain at digital 000 is unity or 1 and the gain at various stages are set by 4051.

Precision Attenuator with Digital Control – delabs

There are eight different gains as the steps of gain resistor network is chosen by 4051. The on resistance of 4051 channel around 100E gets added to U1 pin 2 internal impedance.

Digital gain control of Opamp

Auto ranging 4-1/2 Digit Digital Voltmeter – delabs

You can use separate resistor networks with trimpots for each channel if you require but keep the networks total burden on U1 pin 6 to around 10K, not less than than. You can use this to set the gain of a amplifier with the help of a microcontroller.

Interface a uC to PC RS232 with MAX232A

This is the standard configuration on how to Interface a uC like 8051 to PC RS232 with MAX232A. The UART or Serial port was not present in 8049/8749 chips which were the ancestors of 8051/8031. Pages of code were needed to make a software UART in MCS-48. The 8051 integrated the hardware UART and short commands made it tick. The most important innovation which made uC popular was the C in 80C31. C is for CMOS. This made the chip work cooler and work on even batteries and small power supplies.

80C51, SBC, Firmware and Circuits

The 8749 and 8751 are the UV EPROM type of uC. With limited erase/write cycles. The FLASH revolution changed every thing, you could update firmware over a phone line modem. Even without Ethernet, the firmware could be updated by making every embedded device a node on the EPABX. Now TCP/IP and Wi-Fi makes it all very easy.

Interface a uC to PC RS232 with MAX232A
Read also –

555 watchdog for uC and uP systems

When the microcontroller hangs due to a spike, EMI or RFI etc. the 7555 will reset the uC, if proper power supply design is done above circuit can also give a clean power on reset, the above circuit you should modify to suit your design.

80C39-8749 MCS-48 Examples and code

Better still use a uC with watchdog built in like some atmel chips, or use the watchdog chips from maxim which can also do RAM battery management.

The circuit was developed over a old TI application note, 7555 i think fairchild may be making it, 7555 is CMOS version of 555 timer, advantage of 7555 is that it can go to higher frequency, low power consumption, the disadvantage is its output drive mA is not as good as 555. now why i put it here was that you can see how charge and discharge paths are separated with diodes.

555 watchdog for uC and uP systems

See Larger Circuit. 555 Watchdog
Edit the circuit eagle cad file del00013.zip,

RS232 with Opto-Isolation

I had to once interface an high voltage circuit to PC, The uC had to communicate thru RS232–Comm port–Serial Port.

Part of the 80C31 8051 SBC

Even though i had isolation at the sensors and actuators to make doubly sure the PC also has been isolated. There are chips that are available for this purpose, The circuit above is built with discrete and passive components except for the opto 4N35. You can use MCT2E and CNY17-3 Optos too. For MCT2E some tweak may be needed as current transfer ratio is 20, for the other two CTR is 100 so above design will work.
RS232 with Opto-Isolation

The circuit derives power from PC but does not load the PC supply. Any voltage above 5V applied to the PC connectors may lead to damage of motherboard in PC. Old PCs were more vulnerable but PCs today maybe a bit rugged at the Ports. Due to internal current limits and clamping.

The VCC, VDD and Agnd are derived from PC no other power needs to be applied on PC side of opto. On uC side of opto the uC power supply lines +5 and gnd has to be used. There is no copper link between the two sides and depending on opto a 1KV isolation is possible if PCB is well designed. The PCB should show the visual isolation above and components should be laid on separate areas of PCB to prevent creepage.

The LEDs are to indicate the port activity Rx and Tx, they are not required once testing is over. The circuit can be simpler, but this worked for me and it is not tested at very-high buad rates.

The levels of RS232 are not TTL like 0-5 we have both polarities +10 and -10. The circuit has to change that to drive the Opto Leds.

RS232 software. Understanding RS232 Serial Port Communication.

Voltage to Frequency Converter AD Interface

This is the Analog front end of the 80C39 Process Controller. The analog input is protected by a Zener barrier, low leakage. You could use clamping diodes too.

The non-inverting low-offset amp offers high input impedance. After further amplification it reaches the VCO LM331. The pulse train from the VCO reaches the uC port and is gated and measured by the MCS48 firmware. The voltage is deduced from the Frequency or Pulse width.

Voltage to Frequency Converter AD Interface

You can get a resolution near to a 8-10 bit A/D converter. It does not work for negative voltages. It is a low cost Voltmeter or Process Display solution.

80C39 and MCS48 based Process Controller is the main circuit that has the LED 7 segment display for output and push keys for input.

Battery Backup Supply

This is a 9V power supply which will work even on power failure. It uses a rechargeable battery and regulators. A transformer with 15-0-15 AC volts output is required.

From my Power Electronic Circuits

Battery Backup Supply

In the first regulator U1 the output is lifted up by 1.4V and in the second regulator U2 by a resistor divider. In the second regulator the voltage across resistor R3 is 5V, so the current is 5V / 1K = 5mA this adds to the quiescent current of 5mA from the regulators ground terminal and flows into the resistors R1 and R2 in parallel which form 404 ohms, 10mA thru 404 ohms is 4V. So the output will be 5 + 4 = 9V. Note that the charge and discharge paths of the battery are separated with diodes.

Digital to Analog Converter with uC Watchdog

This is the continuation of the earlier post. Part of 80C39 based Process Controller. In this schematic you can see the Watchdog and D/A Converter.

Digital to Analog Converter with uC Watchdog

My first observation of a very complex watchdog in action was an Agilent(hp) Benchtop Multimeter based on this 8048 family of 1st generation microcontrollers that did not even have a UART among many things.

At that time CMOS was just making an entry and FLASH memory was unheard of. The UV Eprom was the way firmware was set on these systems. These consumed a lot of power. 80C39 was the CMOS one.

The  4040 counter derives a slow clock from the 7555 timer. The counter has to be reset by firmware by periodically sending a reset pulse on port pin P2.7 to say “Alls Well”.

If the firmware or uC “hangs” or due to EMI or Spikes the uC gets into an endless loop. Then the “Alls Well” pulses stop coming. The 4040 keeps counting till Q10 output goes high and resets the uC or can we say Wakes it up rudely.

The D/A converter was used to get the 1-5 V to obtain 4-20 mA control Signal to operate the Actuators like a Motor Drive or Heaters in a Industrial Process control System.