Question
I am struggling to get this Project to work and I've spent countless hours trying and nothing seems to be doing the trick. This is
I am struggling to get this Project to work and I've spent countless hours trying and nothing seems to be doing the trick. This is for a Dragon12-Plus and the issues I'm having are as follows:
set_LCD is conflicting with the song stack
Need to set the first song to one of the four buttons and set the other song to the other button.
When you click a button, the song plays and it displays its name in the bottom part of the LCD panel.
I am going to provide an image of my code. I'm not sure how I would be able to show my appreciate but I will give it a like.
\begin{tabular}{lll} DB2 & equ & 4 \\ DB3 & equ & 8 \\ DB4 & equ & $10 \\ DB5 & equ & $20 \\ DB6 & equ & $40 \\ & & \\ OL5 & equ & DB2 \\ OM5 & equ & DB3 \end{tabular} TB1MS: equ 24000;1ms time base of 24000 instruction cycles :24,0001/24MHz=1ms at 24MHz bus speed REGBLK: equ ' $0 \#include reg9s12.h ;include register equates F3500HZ: equ 3429 lod_dat equ PortK-Define LCD data port Icd_dir equ DDRK;-Define LCD direction port Icd_E equ \$02;Define pin for LCD enable signal lod_RS equ \$01;-Define pin for LCD RS signal org $1000 counter rmb 1; Resenve memory for counter variable spk_tone: rmb 2 sound_dur: rmb 1 xsound_save: rmb 2 sound_repeat: rmb 1 xsound_beg: rmb 2 sound_start: rmb 1 rest_note: rmb 1 count_5ms: rmb 1 \begin{tabular}{lcc} note_c & equ & 0 \\ note_cs & equ & 1 \\ note_d & equ & 2 \\ note_ds & equ & 3 \\ note_e & equ & 4 \\ note_f & equ & 5 \\ note_fs & equ & 6 \\ note_g & equ & 7 \\ note_gs & equ & 8 \\ note_a & equ & 9 \\ note_as & equ & 10 \\ note_b & equ & 11 \end{tabular} fdb0,0,0,0;dummybytefdbc6,c6s,d6,d6s,e6,f6,f6s,g6,g6s,a6,a6s,b6 folb 0,0,0,0;dummy byte fdb c7,c7s,d7,d7s,e7,f7,f7s,g7,97s,a7,a7s,b7 fdb 0,0,0,0;dummy byte fdbc8 start: Ids \#STACK jsir set_LCD idx \#timer6 stx \$3E62 ; initialize int vetctor LDX \#timer5_spk stx \$3E64 ldx \#F3500HZ ;3.5kHz stx spk_tone Idx \#REGBLK Idaa #$80 staa tscr, x; enable timer Idaa \#DB5+DB6 staa tios, x; select t 6 as an output compare staa tmsk1,x clr count_ 5ms cli jsr spk_on jsr start_sound ; start sound stp: jmp stp spk_on: pshx Idx \#REGBLK bcir tctl1,x OM5 bset tctl1,x OL5 ; toggle speaker pulx its spk_off: pshx Idx \#REGBLK bset tctl1,x OM5 bclr tctl1,xOL5 ;turn off speaker pulx rts timer6: inc count_5ms Idaa count_5ms cmpa \#5 bne tmr3 clr count_5ms : ; processing every 5ms Idaa sound_start beq tmr3 Ida sound_dur ;duration deca staa sound_dur bne tmr3 Idx xsound_save repeat: Idab 0,x cmpb#255 beq sound_end Idaa 1,x cmpa \#255 beq sound_end staa sound_dur in x inx stx xsound_save cmpb \#\$fe bne not_rest Idaa \#1 staa rest_note jsr spk_off jmp tmr3 not_rest: clr rest_note jsi spk_on idx \#NOTE_TABLE aslb abx ;50=1/8 note, 75=1/6 note, 100=1/4 note, 133=1/3 note, 200=1/2 note, 400=1 note :Smaller = Faster / Bigger = Longer double equ 125 dur18 equ 50 dur16 equ 60 dur14 equ 100 pbt equ 8; Pause Between Ticks pbtlong equ 24 :Push - Matchbox 20(Closes I could get) SONGStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started