Yet another Volume controlers and source selections

We have encoder to volume control with button but isn't used. I'd like to use this button to mute. Second encoder or rotary switch use only to change source. I need 3 pins in atmega but don't known with to use. See part control on schematic. Of course we need to modify the program.
Sorry for my english
 

Attachments

  • PGA.pdf
    49.1 KB · Views: 221
Last edited:
Hi,
You have to move IR-diode(RC5) to other pin like PC.7
and use INT1 (PD.3) for new encoder + PD.5 or PD.6 for encoder pin
same way as we use it for encoder on INT0

In one of my PGA2311 versions I have MUTE & ON/OFF in same button
short press MUTE long Press ON/OFF

this way you can free up 1 more pin if needed :)

What version of software for 8515 do you use ?
there is so many versions :)
 
Last edited:
Just a idea how to do it
Code:
Ddrd = &B10000000
Portd = &B01111111
Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portc.1 , Rs = Portc.0

Config Lcd = 16 * 2
Cursor Off
Cls

'rc5  IR OUT to PortC.7
Config Rc5 = Pinc.7 , Wait = 2000

Declare Sub Shiftlf()
Declare Sub Shiftrt()
Declare Sub Volup()
Declare Sub Voldn()                                         '

'encoder 1 volume
Enc_a Alias Pind.1
Set Enc_a
On Int0 Int_0
Enable Int0
Config Int0 = Falling

'encoder 2 select input
Enc_b Alias Pind.5
Set Enc_b
On Int1 Int_1
Enable Int1
Config Int1 = Falling

Enable Interrupts


Do
 If Pind.0 = 1 Then
   'on off
   Waitms 200
 End If
 If Pind.4 = 1 Then
   'mute
   Waitms 200
 End If

 If Pind.6 = 1 Then
   'menu
   Waitms 200
 End If

 'your other code here
Loop
End

'---------shift input Left----------
Sub Shiftlf()
'your code here
Waitms 500
End Sub
'--------shift input right----------
Sub Shiftrt()
'your code here
Waitms 500
End Sub
'-------bring volume up-------------
Sub Volup()
'your code here
Waitms 50
End Sub
'--------bring volume down----------
Sub Voldn()
'your code here
Waitms 50
End Sub

'  ------------------- Int0 & Pind.1  -------------
Int_0:
Disable Int0
If Enc_a = 0 Then
   Call Volup()
Else
   Call Voldn()
End If
Gifr = 64
Enable Int0
Return

'  ------------------- Int1 & Pind.5 ------------------
Int_1:
Disable Int1
If Enc_b = 0 Then
   Call Shiftlf()
Else
   Call Shiftrt()
End If
Gifr = 64
Enable Int1
Return
 
Hi
Your idea with MUTE and ON/OFF in the same button is very good. I'm modify schematic can you see thet will by good? I moved IR-diode to PINC.7, RELAY-ON/OFF to PINC.6, for second encoder I use PIND.6, and PIND.5. I try to modify your program form post 370. I don't build this volume control yet but the schematic will be ok I start know.
 

Attachments

  • PGA.pdf
    51.3 KB · Views: 139
Hi, Finally i'm build this but I have problem with backlight it's only 1sec when I turn on controler. In the file is schematic and board in pdf and eagle files. If you can tell me what is wrong? I have no idea. Maybe error is in the program?
An externally hosted image should be here but it was not working when we last tested it.

An externally hosted image should be here but it was not working when we last tested it.
 

Attachments

  • pga eagle.zip
    134.3 KB · Views: 203
  • pga pdf.zip
    852.4 KB · Views: 250
Last edited: