
|
The Learning Platform With its history, I tried to make it as a Learning platform to learn. (a) Intel 8051 Micro Controller Programming in Music—Tone Control and Music reproduction + Surround Sound (b) Hardware Integration
I made it.
wanted to share my dream of having to design a truly digital Tone Control, a dream that never happened during my schooling days, my experienced and studies of Software / Firmware Programming. I want to share my little know how in the form of Easy, Affordable, Fast and Fun ways of Learning, and I wanted to be Do-It-Yourself, it means, you learn by yourself.
When I presented to several University in the Philippines — I got a common answer, we too can do this, in fact we have it. But I am glad that, the DATC as a learning platform was voted by University outside the Philippines. In fact, it serves it purpose as Learning and Trainer Kit.
I presented also to Alexan Commercial with no any response from them. I though, they would welcome me, being a person learned a lot from their magazine Electronic enthusiasts.
Well ………………… I guess no one like the DATC!, opsss! When I show my work to my close friend during a week end visit, she volunteer to be the model as shown below : |
|
What’s on the Learning Platform? The TDA7442D cannot work as standalone. It need a Micro Controller Unit (MCU) to tell what to do. The MCU will command the TDA7442 via I2C. A firmware developer will need to develop a program to make the Tone control and surround effect to work.
Well, these are the things need to Learn (a) LCD Displaying (b) keypressed selecting Volume, Treble, Balance and selecting 4 inputs ‘(c) control the Tonal boost and cut for the Treble and Bass +/- 14 dB (d) programmable automatic turn on/off (e) control the MUTE and STANDBY of the Power Amplifier (f) Remote Control
Here is an Example. The DACT have 4 input signal source, they are : CD, DVD, MP3 AND AUX. To select only one of this input, the DATC User need to press any of the four (4) keays. |
|
Hmmmm, tthey may not like the DATC but I am sure, they will like me. |
|
If the User want a CD, he should pressed the CD Key, then the DATC will used the CD as input.
Now, the TDA7442D IC cannot do this without a Program that instruct to check the condition of the 4 switches.
Let’s take a look at the Schematic Diagram of the Switches as shown below : |
|
The Program is keep checking the status of the Keys : K2, K3, K4 and K5.
Anyone of this switch is pressed, it means that the user would like to use it as Input.
Let’s see the program to make this to happen. |
![Text Box: '============================================================================
'PROG 10.0 Scanning the keys K2 and K3
' only for Learning the DATC Trainer Kit
'============================================================================
'
'DESCRIPTION:
'This Program demonstrate how to detect the switch K2 and K3 when the user
'pressed any of these keys. It is disected program (DEMO) fo studying purposes
'
'This is intended to run into the Audio Trainer Board of the DATC Trainer Kit.
'
'
' F. Dandy Menor
' (c) Heart Systems
' October 2005
'
'HARDWARE NOTE:
' Audio Trainer Board [DATC Trainer Kit]
' MCU Type : AT89S52
' Crystal : 12.0 MHz
' LCD Control : Data : P2.0, P2.1, P2.2, P2.3
' R/W : P0.5
' D/I : P0.4
' LCD Control Backlight : Port 0 bit 7 (P0.7)
' Power_ON_Standby_LED : Port 1, bit 2 (P1.2)
'
' Keyboard Column 1 : Port 3, bit 0 (P3.0)
' Column 2 : Port 3, bit 1 (P3.1)
' Row 1 : Port 3, bit 4 (P3.4)
'
'The IDE used to create this program is the BASCOM 8051 IDE DEMO version. Please
'visit www.mcselec.com. Thanks to Mark Albert for his permission.
'
'=========================== CONFIGURATIONS =================================
'LCD CONFIGURATION
CONFIG LCD = 16 * 2
CONFIG Lcdpin = Pin , Db4 = P2.4 , Db5 = P2.5 , Db6 = P2.6 , Db7 = P2.7
CONFIG Lcdpin = Pin , E = P0.4 , Rs = P0.6
'DECLARATION
DECLARE SUB Power_UP_Display 'Subroutine Declarations
DECLARE SUB LCD_Initialization
DECLARE SUB STBY_Flashing_Display
DECLARE SUB SCAN_KEY(KeyNumber AS BYTE)
'NAMING VARIABLES
LCD_RW_control ALIAS P0.5 'Lcd_RW_control bagong pangalan ng P0.5
LCD_Backlight ALIAS P0.7 'LCD_Backlight bagong pangalan ng P0.7
Power_ON_Standby_KEY ALIAS P3.7 'Power_ON_Standby_KEY bagong pangalan P3.7
Power_ON_Standby_LED ALIAS P1.2 'Power_ON_Standby_LED bagong pangalan P1.2
COL_1 ALIAS P3.0 'Keyboard Column 1 ang bagong pangalan ng P3.0
COL_2 ALIAS P3.1 'Keyboard Column 2 ang bagong pangalan ng P3.1
ROW_1 ALIAS P3.4 'Keyboard Row 1 ang bagong pangalan ng P3.4
' DIMENSIONS
DIM KeyNumber AS BYTE 'KeyNumber ay byte type variable
'====================================== PROGRAM START ============================================
'INITIALIZATION
CALL LCD_Initialization 'initialized ang 16x2 LCD
'tawagin ang Sub-program "LCD_Initialization"
CLS 'clear-up ang LCD screen
RESET Lcd_RW_control 'Lcd_RW_control bagong pangalan ng P0.5
RESET LCD_Backlight 'Pailawin ang LCD backlight
CALL Power_UP_Display 'i-display ang Standby Mode display protocol
'tawagin ang Sub-program "Power_UP_Display"
'INITIAL VALUE
KeyNumber = 0 'Ang KeyNumber ay siyang storage ng number kung
'anong INPUT ang napili.
'INPUT numbering assignment
'1=CD
'2=DVD
'3=MP3
'4=AUX
SCANNING_the_KEY:
CALL SCAN_KEY(KeyNumber)
IF KeyNumber=100 THEN 'kung walang napindot na KEY, babalik kaagad ang
GOTO SCANNING_the_KEY 'program flow sa SCANNING_the_KEY para manmanan
END If 'ang mag keys. Kung may napindot na KEY [K2 o K3]
'pupunta ang program flow sa CASES
SELECT CASE KeyNumber
'Kung ang KeyNumber ay
'1 --> i-display nito ang CD
'2 --> i-display nito ang DVD
CASE 1:
CLS
LOCATE 1,1
LCD "You choosed CD"
LOCATE 2,1
LCD "as music INPUT "
CASE 2:
CLS
LOCATE 1,1
LCD "DVD-your choice "
LOCATE 2,1
LCD "as music INPUT "
END SELECT
GOTO SCANNING_the_KEY
'=============================== SUBROUTINES ==================================
SUB LCD_Initialization
P2 = 255 'ilagay ang P2 sa logic 1
Reset Lcd_RW_control 'Put LCD_RW to GND, it is required in 4-bit mode
Waitms 200
Waitms 200
Lcdinit 'i-nitialized LCD display
Cursor Off 'turn off the cursor
Reset LCD_Backlight 'turn on the LCD backlight
Display On 'start to display
END SUB
SUB Power_UP_Display 'i-display ang message
Cls
Upperline
LCD "Scaning Keyboard"
Lowerline
Lcd " CD & DVD INPUT "
END SUB
'--------------------------------------- Scanning the Keys -----------------------------------------------
SUB SCAN_KEY
RESET ROW_1 'i-GND and Row_1 para i-check ang Columns
WAITMS 30 'maghintay ng 30 msec para sa debounced
IF COL_1<>1 THEN 'kung ang Col_1 ay logic 0, ang keyNumber=1
KeyNumber = 1 'ibig sabihin na may pumindot sa K2
ELSEIF COL_2<>1 THEN 'kung ang Col_2 ay logic 0, ang keyNumber=2
KeyNumber = 2 'ibig sabihin na may pumindot sa K3
ELSE
KeyNumber = 100 'kung wala naman napindot na KEY, ang value ng
ENDIF 'KeyNumber ay 100
Scanning_KEYBOARD: 'ang parte na ito ay para i-check
IF COL_1<>1 or COL_2<>1 THEN 'kung nakapindot parin ang K2 o
GOTO Scanning_KEYBOARD 'ang K3, at kung nakapindot parin
END IF 'ii-kot lang ang program logic sa
'Scanning_KEYBOARD. Itong paraan
'na ito ay para walang double
'detection ang KEYpressed.
SET ROW_1 'dahil tapos na ang Scanning ng KEYs puwede
'nang ilagay sa logic 1 ang Row_1 (P3.4). Dahil kung
'hindi, mananatiling naka GND ang P3.4 at magkakaroon ng current sink sa Port P3.4 , dagdag na current 'consumption
END SUB 'utusan ang BASCOM compiler na END ang compilation
'---------------------------------------------------------End of Program -------------------------------------------------------
END](image939.gif)






|
Copyright 2008~2011 by 1 DIY Centre. All rights reserved |
|
Last Updated : March 2012
|
