Using C-52 EVB for simple robot experiments

Not rated 30,971

Circuit Image

The basic circuit using the L293 forms an H-Bridge driver, as shown in Figure 1, is designed for controlling inductive loads like DC motors. External diodes are necessary for suppressing back EMF. The MiniBoard utilizes the L293D, which features internal diodes but has a slightly lower driving capacity of 600mA at 4.5V-36V. The truth table indicates that the motor's direction can be controlled via pins C and D. The VINH pin enables or disables power to the motor, allowing for speed regulation through PWM signaling. A circuit connecting C-52 P1 to the L293 driver chip is illustrated in Figure 2, where the Enable pin 1 is connected to P1.0 for PWM signaling. An additional inverter is used at pins 7 and 15 to ensure proper logic for directional control. Pins 4, 5, 12, and 13 are grounded, and if heat sinking is required, one method is to create a large area on the PCB or solder it to a metal sheet. External diodes must be connected to the L293, although they are not shown in the circuit diagram. The latest design incorporates an additional inverter for the PWM signal at pins 1 and 9 to prevent full power from being delivered to the DC motors when resetting the 89C52 (i.e., when all bits of P1 are logic high). The logic of PWM pins for other microcontrollers should be checked. Since the 89C52 chip lacks an ADC, competitors may build their own Line Tracking Sensors. Some may use an LM339 QUAD comparator with an IR transmitter and receiver, while others may utilize an LDR, as described in the Line Follower Robot. An external comparator may eliminate the need for an ADC; however, an LDR would require an external ADC. It is suggested that having an additional ADC for the 89C52 would be beneficial. A cost-effective method to provide ADC for the 89C52 is through the PIC16C711, which includes a 4-channel ADC and a 7-pin input port. Interfacing with the 89C52 is accomplished using a simple PISO protocol, employing RB0 for SCLK and RA4 for SDA. The code for this purpose is written in C, and the source file is named C52ADC.C, with the HEX file as C52ADC.HEX. After initialization, the 711 chip waits for a trigger read signal at pin RB0 (high-to-low transition) and responds by sending a 40-bit data stream through RA4 (SDA) with a low-to-high transition. The 40-bit data stream starts with the LSB of ADC0 and continues to the MSB of PORT B. An example program for testing the ADC is called ADC.C, with the corresponding hex file named ADC.HEX. Figure 4 displays a simple power supply circuit that has been tested with KABO and functions correctly. For users with high-capacity rechargeable batteries, the resistance value of R can be selected to achieve an approximate 10% output charging current. The DC input can be higher if the battery voltage exceeds 8.4V. To ensure the output current remains within the calculated value of R, DC current should be measured beforehand. The maximum supply voltage for the LM317 is approximately 35V. Figure 4 illustrates the circuit diagram for the battery supply, which includes +12V Alkaline and +8.4V NiMH with a constant current recharger circuit. For a current of around 20mA, a resistor value of approximately 60 Ohms should be used. S1 serves as the main switch for the CPU and L293 circuits. Before generating PWM for testing the aforementioned circuit, it is essential to understand how to utilize Paul’s header. By including Paul’s startup header at the beginning of the application C program, after successfully downloading the hex code, pressing RESET will allow the 89C52 to run the application instead of the PAULMON2 monitor program. As long as the program remains in SRAM, it can only be executed by pressing RESET. To return to the PAULMON2 prompt, the board power must be turned off for a brief period and then turned back on. This startup header concept enables the C-52 EVB to function as a dedicated controller in addition to serving as a learning board. Paul originally developed this entirely in assembly code; however, it has been adapted for the Micro-C Compiler. The header for startup code has been included in the startup and runtime library for the small memory model. The file C52ROBOT.ASM will compile and link to the main() function with S=c52robot.asm when invoking the command coordinator. An example command line is provided.

The circuit utilizes the L293D H-Bridge driver to control the operation of DC motors, allowing for both direction and speed control. The inclusion of external diodes is critical for protecting the circuit against back EMF generated by the inductive loads. The PWM signal is generated through the enable pin, which modulates the power supplied to the motor, facilitating speed adjustments. The circuit design also incorporates inverters to ensure that the control signals are properly interpreted by the driver, thus enhancing operational reliability.

The integration of a PIC16C711 ADC expands the capabilities of the 89C52 microcontroller, enabling it to process analog signals, which is essential for applications like line tracking. The interfacing through a PISO protocol allows for efficient communication between the two microcontrollers, ensuring timely data transfer. The power supply circuit is designed to accommodate various battery types, ensuring versatility and ease of use. The careful selection of resistor values for the charging circuit is crucial for maintaining battery health and ensuring optimal performance.

Overall, this circuit design emphasizes the importance of proper component selection and circuit configuration to achieve reliable motor control and sensor interfacing, making it suitable for various robotics and automation applications.Basic circuit of using L293 formsan H-Bridge Driver is shown in Figure 1. As shown for such inductive loadas DC motor, external diodes for suppressing back EMF must be connected. The MiniBoard uses L293D instead, the L293D has internal diodes, howeverproviding a bit less driving capacity, i.

e. , 600mA @4. 5V-36V. From thetruth table, we see that dire ction of the motor can control by pin C andD. VINH enable/disable power to the motor, thus for speed regulation, wethen use this pin for PWM signaling. See details, L293. pdf data sheet. A circuit connecting C-52 P1 to L293 driver chip is shown in Figure2. As shown Enable pin 1 connected to P1. 0 is for PWM signaling. We useadditional inverter at pin7 and pin 15 to provide proper logic for easydirectional control. Please note that pin 4, 5, 12, 13 are tied to groundand if heat sinking needed, one method is to make a large area of PCB orsoldering it with a metal sheet, say.

Figure 2: Connecting C-52 EVB P1. 4-P1. 7 to L293. External diodes must be connected for L293(not shown in circuit diagram). My latest design put additional inverter forPWM signal at pin 1 and pin 9 to prevent full power delivering to DC motorswhen resetting the 89C52(i. e. , all bits of P1 is logic high). Check thelogic of PWM pins for another microcontrollers. Since there`s no ADC for 89C52 chip, each competitor may build theirown Line Tracking Sensor, some may use LM339 QUAD comparator with IR transmitterand receiver, some may use LDR as described in LineFollower Robot.

With an external comparator, it may not necessaryto have ADC, but with LDR, we need external ADC. " Having additional ADCfor 89C52 would be better", I thought. How can we provide ADC for 89C52with a cheap method I chose PIC16C711 with 4-channel ADC, and 7-pin inputport. Interfacing to 89C52 is done with simple PISO protocol by using RB0for SCLK and RA4 for SDA. The code for such purpose was written in C, hereis the source file, C52ADC. C and the HEXcode, C52ADC. HEX. After some initialization, the 711 chip wait for trigger read signal at pin RB0, i. e. , high-to-lowtransition, then it responses by sending 40-bit through RA4(SDA) with low-to-hightransition.

40-bit data stream begins with LSB of ADC0 to MSB of PORT B. Example of program fro testing ADC is ADC. C and the hex file is ADC. HEX. Figure 4 shows a simple power supply circuit. I have tested with KABO, it works fine. For those who have a big capacity rechargeable battery, the resistance value of R can be selected for approx. 10% output chargingcurrent. DC in can be higher if your battery voltage higher than 8. 4V, say. To ensure the output current is within the value calculated by R, measure DC current before. The maximum supply for LM317 is ~35V. Figure 4: Circuit Diagram of battery supply+12V Alkaline and +8. 4V NiMH with a constant current recharger circuit. For ~20mA, use R~60 Ohms. S1 is main switch for CPU and L293 circuits. Before writing PWM generation for testing above circuit, let study howto use Paul`s header. With a PAUL`s startup header at the beginning ofthe application C program, after successfully downloading the hex code, just press RESET, the 89C52 then will run the application instead of PAULMON2monitor program.

As long as the program remain in SRAM, running the programcan only be done with pressing RESET. To return to PAULMON2 prompt, turnthe board power off for a while, then back the power on again. This conceptof startup header allows us to use C-52 EVB as a dedicated controller besideas a learning board. Originally Paul has made with entirely in Assemblycode. However, I have adapted for Micro-C Compiler. I have put the headerfor startup code in the startup and runtime library for small memorymodel. The file C52ROBOT. ASM, will compileand link to the main( ) function with S=c52robot. asm when invoking commandcoordinator. Example of command line is; One method ofdelivering DC power to motors is to use P 🔗 External reference




Warning: include(partials/cookie-banner.php): Failed to open stream: Permission denied in /var/www/html/nextgr/view-circuit.php on line 713

Warning: include(): Failed opening 'partials/cookie-banner.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/nextgr/view-circuit.php on line 713