PIC18F4580 USB Analyzer Circuit LCD 4-Channel

| July 24, 2024 Updated
PIC18F4580 USB Analyzer Circuit LCD  4-Channel

Often when checking digital signals or debugging devices, a logic analyzer is required as more and more devices are being developed, especially microcontrollers. A simple logic analyzer circuit that can be used for most digital signals and also has a memory function.

The logic analyzer circuit is based on the pic18f4580 microcontroller and a 128×64 graphic LCD (glcd DEM128064A-FGH-PW) is used for the display. The software includes source .asm, .hex and pcb files prepared with assembly.

Features of the logic analyzer circuit;

Sampling Frequency: 200Hz, 2Mhz
Number of channels: 4
Memory: 1024 per channel
Trigger levels (Trigger-Level): +Ve and –Ve
Supply: 12volt + 9V battery

The analyzer circuit has 4 channels, is compact and battery powered. The maximum sampling rate is 2 MHz and the device has enough memory to store 1024 signal samples. The matrix LCD screen with a resolution of 64×128 pixels displays sufficiently sensitively and gives a clear image of digital signals. The automatic charging section that will charge the 9 volt battery used in the circuit is located on the circuit.

Logic analyzer circuit diagram

lojik-analizor-devre-semasi-pic18f4580

The basis of the circuit is the PIC18F4580 microcontroller, which samples and controls the LCD display. It is controlled using a 5-key keyboard (S1-S5). The quartz resonator (X1, 10 MHz) determines the maximum sampling rate. The PLL module integrated into the microcontroller is used to achieve the internal frequency of 40 MHz, which is the maximum according to the manufacturer Microchip.

Diodes D1 – D8 protect the inputs of the microcontroller from too high or negative voltage. Input signals go to the inputs of the IC1 74HC04N integrated circuit, which serves as a buffer. Signals after the buffer chip go directly to the inputs of the RA1 – RA4 microcontroller where they are pre-programmed

Potentiometer P1 is used to adjust the display contrast, transistor T1 controls the backlight. Sound emitter BZ1 signals the start of the next data recording cycle (start of sampling) and when switching between operating modes. Control keys (S1 – S5) do not require contact reversal; This process is implemented in the software.

The power supply of the device is to provide the device with a stabilized 5 V (power supply of the microcontroller and the 74HC04N chip) and a voltage of 9 V, which is used to illuminate the screen. Circuit T2, R1, R17, D12 allows charging of the 9 V battery when connecting a 9 – 12 V external power supply. When using a standard LED, with a voltage drop of 1.5 V, the battery charging current will be equal to:

(1.5 – 0.6) / 56 = 16 mA,

This is sufficient when using a NiMH battery with a capacity of 160 mAh. In this case, the battery will be fully charged in approximately 10 hours. During charging, the D12 LED will light.

pic18f4580-4-channel-logic-analyzer-circuit-glcd-assembly

The S1 key is used to select the sampling rate (scanning) and can take values: 5/10/20/50/100/200/500 μs / division and 1/2/5 ms / division. The S2 key is used to select the channel for trigger synchronization/initiation, and the S3 key is used to select the trigger trigger state: a rising or falling edge.

The S4 key has various functions: start / stop devices, clear the screen. Short press, the device starts (waits for the start condition of data recording), after the synchronization condition is achieved, the microcontroller takes 1024 samples of each channel and saves them. If you press the S4 button again, the microcontroller will make 1024 samples again after the synchronization condition is met. If you press and hold the S4 key for a long time, the screen will be cleared.

The S5 key turns the display backlight on/off, but after 1 minute or when a drained battery is detected, it will automatically turn off.

The latest scan, condition and sync source settings are stored in the microcontroller’s EEPROM and used at the next power-up.

To achieve the maximum possible signal sampling frequency, it allows the microcontroller to write the received data to RAM if the synchronization condition coincides at startup. To do this, follow the instructions below:

movff port a, postinc0

This code copies the contents of the port to RAM and increments the RAM address by one. This cycle is repeated 1024 times. At the end of this cycle, 128 samples are read from RAM and displayed on the screen.

By briefly pressing the S4 key – the microcontroller enters the memory mode and waits for the initialization / synchronization condition, the “R” symbol appears in the right corner on the screen. After synchronization, the 1024 reads are saved to RAM, the “R” icon changes to “S” and the first 128 samples of each channel are shown on the screen. By using the S1 and S2 keys, the user can navigate through the data in the memory, the cursor at the bottom of the screen shows the data in which the current memory area is displayed.

The next short press on the S4 button will cause the device to take samples again and save them into memory, but the screen will show data from the memory area that the user viewed before pressing the S4 button, which is a useful function in some cases.

Q4 If you hold down the key for a long time (you will hear a beep), samples will be taken, but the display will show data from the first (first 128 samples) memory area.

If you press and hold the S4 key longer (two beeps), the device switches to real-time display mode of the first 128 samples on the screen.
Source: http://www.rlocman.ru/shem/schematics.html?di=64291

USB Analyzer Circuit files alternative link :

PIC18F4580 USB Analyzer Circuit LCD 4-Channel

Password: 320volt.com

Published: 2010/05/16 Tags: ,



1 Comment “PIC18F4580 USB Analyzer Circuit LCD 4-Channel

  1. Electronics CircuitsElectronics Circuits

    Framework for USB PIC18F4550 Generic HID VisualStudio

    PIC18F series microcontrollers with USB port USB HID Framework applications can be developed for the open source implementation of the example circuit (USB LCD text transmission) and Visual Studio’s C # source code

    USB Generic HID PIC18F4550

    REPLY

Leave a Reply

Your email address will not be published. Required fields are marked *