info@panadisplay.com
FT800 Audio Primer-Lub Cav

FT800 Audio Primer-Lub Cav

Nov 02, 2018

2 Lub Cav


Ntau lub suab los yog cov ntaub ntawv tuaj yeem ua si los ntawm FT800. Cov zis yog muab ua PWM

teeb liab ntawm ib tus pin, AUDIO_L. Muaj ob qhov suab, Lub suab Synthesizer thiab cov

Suab Playback.


-2.1 Suab Synthesizer

Cov teebmeem zoo muaj pre-loaded nyob rau hauv ib lub tsev qiv ntawv ROM yoj thiab tsis tas yuav siv ib yam ntawm FT800

RAM chaw. Cov neeg siv tswv yim feem ntau muaj peev xwm muab tau los ntawm cov teebmeem no, xws li nias

thaum lub on-screen khawm yog nias, DTMF tones rau xov tooj lossis lub tswb siab ceeb toom. Feem ntau

cov teebmeem yuav ua si ib zaug thiab tom qab ntawd nres. Lwm tus yuav ua si tsis tu ncua. Tag nrho cov npe ntawm tones thiab

cov nta muaj nyob hauv qab:

Tus nqi Nyhuv Nruam Suab
kho
Tus nqi Nyhuv Nruam Suab
kho
00h Silence Y N 32h DTMF 2 Y N
01h square nthwv Y Y 33h DTMF 3 Y N
02h sine wave Y Y 34h DTMF 4 Y N
03h sawtooth yoj Y Y 35h DTMF 5 Y N
04h daim duab peb sab Y Y 36h DTMF 6 Y N
05h Beeping Y Y 37h DTMF 7 Y N
06h Tswb Y Y 38h DTMF 8 Y N
07h Warble Y Y 39h DTMF 9 Y N
08h Carousel Y Y 40h sau ntawv N Y
10h 1 luv luv kav N Y 41h xylophone N Y
11h 2 pips luv N Y 42h tuba N Y
12h 3 luv pips N Y 43h glockenspiel N Y
13h 4 luv pips N Y 44h hloov khoom nruab nrog N Y
14h 5 luv pips N Y 45h trumpet N Y
15h 6 daim ntawv luv luv N Y 46h piano N Y
16h 7 pips luv N Y 47h chimes N Y
17h 8 daim ntawv luv luv N Y 48h suab paj nruag lub thawv N Y
18h 9 pips luv N Y 49h tswb N Y
19h 10 pips luv N Y 50h nyem N N
1Ah 11 daim ntawv luv luv N Y 51h hloov N N
1Bh 12 luv pips N Y 52h cowbell N N
1Ch 13 luv pips N Y 53h nqis siab tshaj N N
1Dh 14 luv pips N Y 54h hihat N N
1Eh 15 luv pips N Y 55h kickdrum N N
1Fh 16 pips luv N Y 56h pop N N
23h DTMF # Y N 57h clack N N
2Ch DTMF * Y N 58h chack N N
30h DTMF 0 Y N 60h ruam N N
31h DTMF 1 Y N 61h unmute N N


Muaj ntau ntawm cov teebmeem cia lub suab tswj (MIDI faj seeb), yog li ntau lub tones yuav tsum generated. Cov ntawv xeem MIDI ua yog siv:

MIDI faj seeb ANSI nco Freq (Hz) MIDI faj seeb ANSI nco Freq (Hz)
21 A0 27.5 65 F4 349.2
22 A # 0 29.1 66 F # 4 370.0
23 B0 30.9 67 G4 392.0
24 C1 32.7 68 G # 4 415.3
25 C # 1 34.6 69 A4 440.0
26 D1 36.7 70 A # 4 466.2
27 D # 1 38.9 71 B4 493.9
28 E1 41.2 72 C5 523.3
29 F1 43.7 73 C # 5 554.4
30 F # 1 46.2 74 D5 587.3
31 G1 49.0 75 D # 5 622.3
32 G # 1 51.9 76 E5 659.3
33 A1 55.0 77 F5 698.5
34 A # 1 58.3 78 F # 5 740.0
35 B1 61.7 79 G5 784.0
36 C2 65.4 80 G # 5 830.6
37 C # 2 69.3 81 A5 880.0
38 D2 73.4 82 A # 5 932.3
39 D # 2 77.8 83 B5 987.8
40 E2 82.4 84 C6 1046.5
41 F2 87.3 85 C # 6 1108.7
42 F # 2 92.5 86 D6 1174.7
43 G2 98.0 87 D # 6 1244.5
44 G # 2 103.8 88 E6 1318.5
45 A2 110.0 89 F6 1396.9
46 A # 2 116.5 90 F # 6 1480.0
47 B2 123.5 91 G6 1568.0
48 C3 130.8 92 G # 6 1661.2
49 C # 3 138.6 93 A6 1760.0
50 D3 146.8 94 A # 6 1864.7
51 D # 3 155.6 95 B6 1975.5
52 E3 164.8 96 C7 2093.0
53 F3 174,6 97 C # 7 2217.5
54 F # 3 185.0 98 D7 2349.3
55 G3 196.0 99 D # 7 2489.0
56 G # 3 207.7 100 E7 2637.0
57 A3 220.0 101 F7 2793.8
58 A # 3 233.1 102 F # 7 2960.0
59 B3 246.9 103 G7 3136.0
60 C4 261.6 104 G # 7 3322.4
61 C # 4 277.2 105 A7 3520.0
62 D4 293.7 106 A # 7 3729.3
63 D # 4 311.1 107 B7 3951.1
64 E4 329.6 108 C8 4186.0


Lub suab synthesis yog tswj los ntawm cov npe hauv qab no:

 REG_SOUND

o Teeb 31-16 = Tsis txhob tu

o Ntaus 15-8 = MIDI faj seeb (pitch)

o Khoom 7-0 Effect

 REG_PLAY

o Khoom 31-1 = Tsis txhob tu

o Bit0 = Pib Ua Si / Ua Si

Sau ntawv = 1 mus pib ua si xaiv hauv REG_SOUND

 Nyeem = 1 qhia tias qhov tshwm sim tam sim no ua si

 Nyeem = 0 qhia tias qhov tshwm sim tiav lawm

 REG_VOL_SOUND

o Khoom 31-8 = tsis saib xyuas

o Khoom 7-0 = tso zis

Nyeem thiab sau ntawv rau FT800 nco chaw yog siv los ntawm "hom xov tooj me me", qhov twg

tus thawj byte yuav yog qhov tseem ceeb kawg. Piv txwv, xav txog qhov kev txav thuam lub piano (0x46) ua si A4

(0x45). Cov ntaub ntawv ntawm SPI los yog I2C interface yuav txhaj ib lub Hoob Hwm Lus Sau ntawv nrog

cov ntaub ntawv nram qab no, ntawm kev txiav txim:

0x90 = Host Memory Sau ntawv hloov (0x80) ntxiv rau thawj qhov chaw nyob ntawm chaw sau npe (0x10)

0x24 = ob byte ntawm chaw sau npe

0x84 = peb byte ntawm chaw nyob

0x46 = piano nyhuv

0x45 = lus cim / suab = A4 (440Hz)

0x00 = tsis saib xyuas, yeem

0x00 = tsis saib xyuas, yeem

Nco ntsoov tias ob lub bytes dhau los tsis tas yuav sau, yog li 16-ntsis Lub Hauv Paus Tsev Kawm Ntawv Sau ntawv tuaj yeem ua tau

txaus siab rau qhov tseem ceeb uas yuav tsum muaj nyob rau hauv lub npe. Ntxiv kev piav qhia ntawm Lub Hoob Hwm Lus Sau, Hawm

Nco Kev Nyeem Ntawv thiab Hwm Lub Neej Hloov cov ntaub ntawv hloov tsheb muaj nyob hauv AN_240 FT800 Los ntawm

Av tuaj.


-2.2 Suab Ntaub Ntawv

Tej zaum yuav muaj kev siv qhov twg ntau dua li cov laus yooj yim synthesis tsim nyog. Rau

Piv txwv li ib lub suab los yog lwm cov ntawv tshaj tawm yuav tsum tau muab rau tus neeg siv

cov lus qhia. Qhov FT800 txhawb kev ua si ntawm cov ntaub ntawv hauv cov nram qab no ib leeg-channel (mono) tawm tswv yim:

 8-khoom tau kos npe rau PCM - tsis muaj suab nrov

 8-qhov khoom μLAW - cov duab tsis muaj linear

 4-theem IMA-ADPCM - ntxiv compressed μLAW qhov twg txhua tus byte muaj ob tug 4-ntsis

kuaj

Tus FT800 muaj 256Kbytes ntawm kwv ram (RAM_G) tuav cov khoom yees duab (dluab thiab cov ntawv) thiab

suab khoom (cov suab kaw tseg). Lub chaw yuav tsum tswj hwm los ntawm tus tswv tsev MCU li ntawd

cov ntaub ntawv tsis muaj sau tseg kom txog rau thaum tom qab tsis tas yuav tsum tau ntxiv.

Cov ntaub ntawv audio yog loaded los ntawm lub Hoob Hwm Lus Sau xov tooj sau kev sib pauv mus rau qhov chaw thiab muaj

yuav tsum muaj 8-byte kws (64-ntsis).

Thaum ib lub suab xa mus rau hauv RAM_G nco, playback yog tswj los ntawm cov hauv qab no

sau npe:

 REG_PLAYBACK_START

o Teeb 31-20 = tsis saib xyuas

o Khoom 19-0 = 20-ntsis pib qhov chaw nyob ntawm cov ntaub ntawv hauv RAM_G

 REG_PLAYBACK_LENGTH

o Teeb 31-20 = tsis saib xyuas

o Khoom 19-0 = 20-ntsis ntev ntawm cov ntaub ntawv hauv RAM_G

 REG_PLAYBACK_FREQ

o Teeb 31-16 = tsis saib xyuas

o Khoom 15-0 = 16-ntsis Playback sampling zaus zaus, hauv Hz

 REG_PLAYBACK_FORMAT

o Teeb 31-2 = tsis saib xyuas

o Khoom 1-0 = 2-ntsis Playback hom

 0 = Tawm, lossis tsis khov PCM

 1 = μLaw

 2 = ADPCM

 3 = undefined

 REG_PLAYBACK_LOOP

o Khoom 31-1 = tsis saib xyuas

o Bit 0 = 1-ntsis Playback style

 0 = ua si ib zaug

 1 = ua si tas li

 REG_PLAYBACK_PLAY

o Khoom 31-1 = tsis saib xyuas

o Ntsuas 0 = Pib Ua Si / Ncig Ua Si

Sau ntawv = 0 los sis 1 mus pib ua si xaiv hauv REG_SOUND

 Nyeem = 1 qhia tias cov ntaub ntawv yog tam sim no ua si

 Nyeem = 0 qhia tias cov ntaub ntawv tiav

 REG_PLAYBACK_READPTR

o Teeb 31-20 = tsis saib xyuas

o Khoom 19-0 = 20-ntsis pointer ntawm qhov chaw ua si tam sim no

 REG_VOL_PB

o Khoom 31-8 = tsis saib xyuas

o Khoom 7-0 = tso zis


-2.2.1 Hloov Chaw Ua Haujlwm

FTDI muab cov ntaub ntawv tawm suab ua suab npe hu ua "AUD_CVT" mus nqa ib hom ntaub ntawv ntau thiab

tsim peb hom ntaub ntawv raws li FT800. Ib qhov txuas mus rau qhov chaw pabcuam no muaj nyob hauv

"Daim Ntawv Rhais A - Cov Lus Qhia" ntawm daim ntawv no.

Cov ntaub ntawv tau muab los ua ib qho nqaij nyoos (uncompressed) 16bit PCM, mono WAV ntaub ntawv. Xws li cov ntaub ntawv tau

raug tsim los ntawm ib qho kev pabcuam siv suab nrov, xws li Audacity. Thaum lub

cov ntaub ntawv muaj nyob, tsuas yog khiav cov dej taws ntawm kev hais kom ua:

aud_cvt -i inputfilename -f hom ntawv

qhov twg "hom ntawv" = 0 rau 8-ntsis kos npe rau PCM

= 1 rau 8-ntsis μLaw

= 2 rau 4-ntsis IMA ADPCM

Ib lub nplaub tshev nrog cov ntaub ntawv uas tau tsim yuav raug tsim. Cov ntaub ntawv no tuaj yeem siv los thauj hauv

RAM_G cheeb tsam ntawm lub FT800.

Lub tshuab ua suab paj nruag yuav tso tawm ib qho nqaij nyoos thiab compressed rau txhua hom ntawv xaiv. Nws

tej zaum yuav pab tau ntawm tus tswv tsev MCU khaws cov ntaub ntawv muab cov ntaub ntawv cia, thiab mam li nthuav lawv mus rau

RAM_G tsis thaum twg xav tau. Saib Tshooj 4 kom paub meej.