Tuesday, 05 December 2023
Main Menu
Home Home
Shop Shop
News News
Products Products
Application Notes Application Notes
Publications Publications
Links Links
Support Center Support Center
Downloads Downloads
Forum Forum
Resellers Resellers
Contact Us Contact Us
Updates Updates
MCS Wiki MCS Wiki
Online Help
BASCOM-8051 Help BASCOM-8051 Help
Contents in Cart
Show Cart
Your Cart is currently empty.
Search the Shop

Products Search

User Login


If you have problem after log in with disappeared login data, please press F5 in your browser

RSS News

AN #154 - Useful modding - spectrum's analyzer + watch Print
Rubashka Vasiliy , Ukraine , 2007

The general hobby of modding has not bypassed and me. Two lights-emitting diode matrixes 5*8 was completely becoming in a five-inch compartment of a computer - that I had seen decided to make it on basis of spectrumsí.

This is idea of the device: the computer program should allocate a spectrum of a sound signal and through a serial port to transfer the data to the microcontroller which in a dynamic mode serves a light-emitting diode matrix. I have looking for information on decomposition of a sound and conclude, to make it with the help of special library for processing a sound bass.dll with distribution what include set of examples in different programming languages of high level.

The microcontroller ATMEL AT90S2313 is the heart of device, if the program to alternate it is possible to use and ATTINY2313. The controllers accepts the data from a serial port and with the help of conclusions of port B and the additional decoder 74145 is deduce a spectrum on the light-emitting diode screen are collected from two matrixes. The unit of the coordination of levels COM - TTL is collected on to transistor. Brightness of a matrix depends from resistors R4-R11. 

The device was collected on two printed-circuit-boards. Two light-emitting diode matrixes were established in the first, and other elements - in the second. The decorative overlay is cut out from an unused plastic of five-inch insert.

 The program of the microcontroller was written in BASCOM-AVR. The managing program from the part of a computer is written on VISUAL BASIC. The program was altered from, example of library for processing a sound bass.dll. Some fragments were added to it. One of itís program to be breaks and averages the spectrum in to 16 sites, others to process buttons of management to organize the virtual light-emitting diode screen and to receive data in a serial port. After had earned spectrumís analyzer, has added watch in to and casual inclusion - deenergizing of light-emitting diodes. Spectrumís analyzer had two operating modes - columns and points.

Source code:

'* Filename    : LED-MATRIX 5*16
'* Revision    : 1.0
'* Controller  : AT90S2313
'* Compiler    : BASCOM-AVR DEMO
'* Author      : Rubashka Vasiliy , Ukraine , 2007
'* WWW         : http://ledeffects.net
'* Mail        : info@ledeffects.net
'$regfile = "attiny2313.dat"
$regfile = "2313def.dat"
$crystal = 11059200
$baud = 9600
Const Buffer_size = 10
Config Portb = Output
Config Portd.= Output
Config Portd.= Output
Config Portd.= Output
Config Portd.= Output

Dim Base As Byte
Dim Temp As Byte
Dim Comdata As Byte
Dim Bad1 As Byte
Dim Bad2 As Byte
Dim Bad3 As Byte
Dim Bad4 As Byte
Dim Bad5 As Byte
Dim Bad6 As Byte
Dim Bad7 As Byte
Dim Bad8 As Byte
Dim Bad9 As Byte
Dim Bad10 As Byte
Dim Index As Byte
'Portb = &HFF
 ' Timer0 Interrupt
Config Timer0 = Timer , Prescale = 64
On Timer0 Timer0isr                                         ' Timer0 Auto Reload Timer Mode
Enable Timer0 ' Enable Timer0
Enable Interrupts ' Enable All Interrupt
Start Timer0 ' Start Timer0

Base = Inkey()
If Base = "S" Then
Gosub Download
End If

For Index = 0 To 9
Temp = Waitkey()
 If Temp > "9" Then
     Temp = Temp - 7
 End If
 Shift Temp , Left , 4
  Comdata = Temp And &HF0
Temp = Waitkey()
 If Temp > "9" Then
     Temp = Temp - 7
 End If
  Temp = Temp And &HF
  Comdata = Comdata Or Temp

 Select Case Index
 Case 0 : Bad1 = Comdata
 Case 1 : Bad2 = Comdata
 Case 2 : Bad3 = Comdata
 Case 3 : Bad4 = Comdata
 Case 4 : Bad5 = Comdata
 Case 5 : Bad6 = Comdata
 Case 6 : Bad7 = Comdata
 Case 7 : Bad8 = Comdata
 Case 8 : Bad9 = Comdata
 Case 9 : Bad10 = Comdata
 End Select
 Next Index

Timer0isr: ' Timer Interrupt 0
Portb = Bad1
Portd = &H00
Gosub Outd
Portb = Bad2
Portd = &H04
Gosub Outd
Portb = Bad3
Portd = &H08
Gosub Outd
Portb = Bad4
Portd = &H0C
Gosub Outd
Portb = Bad5
Portd = &H10
Gosub Outd
Portb = Bad6
Portd = &H14
Gosub Outd
Portb = Bad7
Portd = &H18
Gosub Outd
Portb = Bad8
Portd = &H1C
Gosub Outd
Portb = Bad9
Portd = &H20
Gosub Outd
Portb = Bad10
Portd = &H24
Gosub Outd
Portb = &H00

Waitus 100