Multi-port programmable neon lights and lantern controllers

Publisher:轻松自在Latest update time:2006-07-21 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  Most of the existing neon lights and lantern controllers use special integrated circuits, which have multiple flashing modes and generally only provide 4 to 16 outputs. Since there are quite a lot of controller channels used in large neon lights, they can generally only be customized, which is expensive and has poor flexibility. This design adopts Liyuan Company's new generation BASIC microcontroller PS1016 and cost-effective 8-bit LED control driver PS7219, which can realize multiple ports and control any port. It can be widely used in large neon lights and plastic neon lights. As well as the programmable control of lanterns, it can be programmed directly on the product and debugged on the computer for direct transmission. It has the characteristics of simple design and easy use.

1 Introduction to main components
1.1 PS1016 microcontroller

  The pin arrangement of PS1016 microcontroller is shown in Figure 1. Its characteristics are as follows:

  1. The PICBASIC interpreter solidified inside the chip provides 32 statements;

  2.20MHz system clock, 16 bidirectional bits can be independently programmed as input/output (I/O) ports, supporting a variety of I/O operations;

  3. The PICBASIC source program is stored in the expanded 24LC16BE 2 PROM. The capacity of E 2 PROM is 2K bytes, which can store approximately 600 to 800 statements.

1.2 8-bit LED control driver PS7219

  The pin arrangement of PS7219 is shown in Figure 2. PS7219 is a high performance, low price multi-bit LED display driver. It is fully compatible with MAX7219 in terms of performance and adds functions such as bit flash. Its interface adopts the popular synchronous serial peripheral interface (SPI), which can be easily interfaced with any kind of microcontroller, and can provide 64 outputs or drive 64 independent LEDs at the same time. PS7219 has a 15×8 RAM function control register inside, which can be easily addressed. Each digit can be controlled and refreshed independently without rewriting the entire display. The brightness of the display can be controlled digitally. Each bit has a flicker enable control bit. When the pin CON is set to high level, all displays can be disabled to achieve the effect of reducing power consumption without affecting the modification of the control register. The PS7219 also has a power-down mode, a scan limit register that allows the user to select from a 1-digit display to an 8-digit display, and a test mode that forces all LEDs on. N PS7219s can be cascaded to achieve N × 8-bit LED display.

2 Hardware design

  The hardware block diagram is shown in Figure 3.


  Figure 3 Multi-port programmable neon light and lantern controller block diagram

  Keyboard input Since the requirements for keys are not too high, PS1016's unique POT statement is used to identify the pressed keys; the digital display is four 8-segment numbers. The tube can be driven by the LED driver SAA1064 with I 2 C interface; the interface with the microcomputer uses the MAX232 interface circuit.

  The entire system is based on the single-chip computer PS1016, which controls the input and output of the entire system. Its control can be divided into two states: programming and running. In the programming state, PS1016 accepts input from the small keyboard and processes the data and stores it in the 1M-bit CMOS serial E 2 PROM24LC256. During operation, the data is sequentially taken out from 24LC256 and sent to each PS7219 according to the programming design requirements. The port is lit and the entire program runs in a loop. Each additional extension adds 64 outputs.

3 Software design

  The entire program is also divided into two parts: programming and operation. The overall block diagram of the program is shown in Figure 4.

      Figure 4 Program flow diagram

  The key to this program lies in the input, reading and writing of data. For reading and writing of 24LC256 and writing format program for PS7219, please refer to the relevant manual of Liyuan. The data structure and flag bits stored in 24LC256 can be determined according to needs, which will facilitate the use of a microcomputer to download control codes through the RS232 port in the future. After the program of PS1016 microcontroller is compiled on the microcomputer, it is downloaded to the microcontroller through the developer.

  PS1016 uses two pins, SDA and SCL, to form an I 2 C bus interface with a data transfer rate of 60kHz, allowing PS1016 to expand I 2 C devices.

  The I 2 C data transfer format is shown in Figure 5:

  Among them, S is the start signal, A is the response signal, R/W is the read/write bit, and P is the stop signal.

S

device

type

device

choose

R/W

A

Data 1

A

Data 2

A

Data 3

A

P

Figure 5I 2 C data transfer format

  24LC256 works in single-byte read and write or page read and write mode, using data 1 and data 2 to form high and low bit addresses. The following is the PS1016 read and write 24LC256 program to achieve single-byte data writing and reading.

'###Write 24LC256###
'W10 keyboard input port number to be lit
'The high bit is b21 and the low bit is b20
'W116-bit address counter high bit is b23 and low bit is b22
IICOUT$0A,$02,b23,b22,b21 'Write high-bit data
W11=W11+1
IICOUT$0A,$02,b23,b22,b20 'Write low-bit data
W11=W11+1
goto KEYBOARD INPUT 'Go to keyboard input subroutine

'###Read 24LC256###
W11=0 'Clear address counter
IICIN$0A,$02,b23,b22,b21 'Read high-order data

W11=W11+1

IICOUT$0A,$02,b23,b22,b20 'Read low-bit data
If w11=$FFFFthen START 'End mark, start again
W11=W11+1
… 'Send W10 data to PS7219 subroutine
goto LOOP

  This design has been successfully produced and used in the neon lights (237 channels in total) advertising in shopping malls in Huaiyin City. It has good performance, flexible use and low price. affirmed by users.

  The above program design, if slightly modified, can be used in other fields such as the controllable display of large-scale fireworks.

References
1PS1016BASIC Microcontroller Instruction Manual. Wuhan: Wuhan Liyuan Electronics Co., Ltd., 1997.5

Reference address:Multi-port programmable neon lights and lantern controllers

Previous article:Heat source automatic tester based on microcontroller control
Next article:Multi-port programmable neon lights and lantern controllers

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号