Yet another Volume controlers and source selections

bar graph

yep, Jempie, I have *.bas file. But my schematic significantly differ from schematic originaly posted by danzup and therefore my *.bas file and firmware differ from *.bas file and firmware posted by dan.
And I didn't finish my firmware yet, I need finish LCD print subroutine, because M8515 control not only pga2310 but passive preamp too (treble, bass)...
P.S.: and one more photo
 

Attachments

  • IMAG0058.jpg
    IMAG0058.jpg
    438.6 KB · Views: 1,161
Pryanick,

wow, thats look good. So you have build the same as Danzup only with tone control
ik like to build this and try if this work better then the one with the motor drive
it work, but on the display you only see volume up and down not an indication of the position of the Alps.

Jempie
 
We shouldnt forget that the source code author is Dan so if only Dan didnt wrote his firmware under PGA2310 I wouldnt wrote my firmware version with PGA2310. The only thing ive done - I modified danzups code for my needs, thats it. As for me I think that volume control with ALPS a bit more better then with PGAxxxx. Why? PGAxxx contains opamps and this is not good for sound. But ALPS doesnt. When I complitely finish my preamp with volume control I publish an article on my web page and put the link here. But by now Im working on fade out on mute (sound slowly goes down to -95.5db and after -95.5db is mute) and fade in on unmute (sound slowly goes up to the value wich was befor mute button was pressed), fade out does work properly, but fade in does not yet - sound appears like ordinary unmute, Im going to solve this problem because this option is very attractive for me...
 
New bar graph version

Hi
I pimped a bit my bar graph version. Now the bar on lcd crawls from one dot to enother (a dot by dot). In previous old version bar moved symbol by symbol (by 5 dots at once).
P.S.: Some test photoes
 

Attachments

  • IMAG0070.jpg
    IMAG0070.jpg
    501.5 KB · Views: 1,043
  • IMAG0071.jpg
    IMAG0071.jpg
    459.7 KB · Views: 937
  • IMAG0072.jpg
    IMAG0072.jpg
    491.8 KB · Views: 838
  • IMAG0073.jpg
    IMAG0073.jpg
    544.2 KB · Views: 763
  • IMAG0074.jpg
    IMAG0074.jpg
    530.7 KB · Views: 143
  • IMAG0075.jpg
    IMAG0075.jpg
    472.1 KB · Views: 155
the volume control does not store last session volume & source value in eeprom, is it possible to include this function in "BAS" coding ? After turn on, it will count until last session volume & source.. It will be complete one after include that function.. hope some one can help & clarify..thanks..:-D
 
Last edited:
the volume control does not store last session volume & source value in eeprom, is it possible to include this function in "BAS" coding ? After turn on, it will count until last session volume & source.. It will be complete one after include that function.. hope some one can help & clarify..thanks..:-D

That was not included in firmware presented here because the lack of knowlidge of user in working with microcontroller / programmer .
For the brave one I have the saving in EEprom feature but that firmware have an aditional file that must programmed last in eeprom of atmel .
Do not ask me how : I am not in mood to explain atmel avr programing and stuff !
If you search on the link given by me to the romanian forum there I have attached a version for R/2R variant that save last settings in eeprom (must find that files and attach here ...)
I will add that feature for all version of firmware / projects sometime in future .
 
the volume control does not store last session volume & source value in eeprom, is it possible to include this function in "BAS" coding ? After turn on, it will count until last session volume & source.. It will be complete one after include that function.. hope some one can help & clarify..thanks..:-D

The point is that microcontroller should be always turned on. You must have separate power supply for microcontroller, so it keeps all settings, even when preamp is off.
 
The point is that microcontroller firmware must write L, R, input, mute values into eeprom every time when you use volume up/down, mute/unmute and input selection because M8515 doesnt know when you turn off it and L, R, input, mute values will be stored in eeprom and next time after powered on the data will be read from eeprom.

Is it wise to check EEPROM in evry loop ? If the value is same , Do Nothing.
If value is not same, Write in EEPROM but I do not know if EEPROM write has life cycle..if we loop in that way, it may very fast get worn out... :D
 
3. Control and audio select with relay and r2r volume
- volume with quality MELF resistors for r2r or shunt adjusting
- infrared remote control in the stop / start amplifier
- selection from 4 sources of signal relays
- version Display with LED or LCD display as it wants ( depending on board will possible planting to serve both variants )

could not found any source code, am I left out ? wish to see how implemented the EEPROM store features on R/2R. I found one implemented in PIC but that code wil check n write teh EEPROM evey loop, I worry it wiil damage the EEPROM since it has write cycle lifespan.. pls enlighten me.. thanks;)
 
could not found any source code, am I left out ? wish to see how implemented the EEPROM store features on R/2R. I found one implemented in PIC but that code wil check n write teh EEPROM evey loop, I worry it wiil damage the EEPROM since it has write cycle lifespan.. pls enlighten me.. thanks;)
For this one I never atached the souce code only the .hex files to be programmed in Atmel .
The internal eeprom of atmel avr have a 100000 write/erase cycles .
In Bascom free to download you will find code example explain very well about the implement and use of internal eeprom.
The firmware variant I have attached here in this thread do not save in eeprom !
It is supposed that the controller is always on powered by stand by power source .
 
$eeprom read/write

........
Dim Inp_sel As Byte
Dim Inp_selbass As Byte
Dim Inp_seltreble As Byte
Dim L As Byte
Dim R As Byte
Dim Gain1 As Integer
.........
'the following DATA lines data will go to the EEP file
$eeprom
$eepromhex
Label2:
Data 2
Label3:
Data 1
Label4:
Data 1
Label5:
Data 101
Label6:
Data 101
Label7:
Data -46%
$data
.......
Readeeprom Inp_selbass , Label2
Readeeprom Inp_seltreble , Label3
Readeeprom Inp_sel , Label4
Readeeprom L , Label5
Readeeprom R , Label6
Readeeprom Gain1 , Label7
......
Writeeeprom Inp_selbass , Label2
......
EEP-file I put into M8515 EEPROM.
L, R , Gain1 read/write is perfecto!
But Inp_sel, Inp_selbass, Inp_seltreble only reading procedure works fine and write process fails. Everytime I powerON the device M8515 reads the same data from eeprom, it reads eep-file which I put in M8515eeprom first time.
May be some delay requires after write procedure was started?
 
........
Dim Inp_sel As Byte
Dim Inp_selbass As Byte
Dim Inp_seltreble As Byte
Dim L As Byte
Dim R As Byte
Dim Gain1 As Integer
.........
'the following DATA lines data will go to the EEP file
$eeprom
$eepromhex
Label2:
Data 2
Label3:
Data 1
Label4:
Data 1
Label5:
Data 101
Label6:
Data 101
Label7:
Data -46%
$data
.......
Readeeprom Inp_selbass , Label2
Readeeprom Inp_seltreble , Label3
Readeeprom Inp_sel , Label4
Readeeprom L , Label5
Readeeprom R , Label6
Readeeprom Gain1 , Label7
......
Writeeeprom Inp_selbass , Label2
......
EEP-file I put into M8515 EEPROM.
L, R , Gain1 read/write is perfecto!
But Inp_sel, Inp_selbass, Inp_seltreble only reading procedure works fine and write process fails. Everytime I powerON the device M8515 reads the same data from eeprom, it reads eep-file which I put in M8515eeprom first time.
May be some delay requires after write procedure was started?

thanks.. wil try out..:eek:
 
Hey :)

If anyone like to use Dallas DS1267 dual pot I made a smal test code for bascom :

Two digitally controlled, 256-position potentiometers
The DS1267 is offered in three standard resistance values which include 10, 50, and 100-kohm versions.
Available packages 14-pin DIP, 16-pin SOIC, and 20-pin TSSOP.
- +5 Volt Supply
– DS1267-10 ~ 10k
– DS1267-50 ~ 50k
– DS1267-100 ~ 100k
- Datasheet http://datasheets.maxim-ic.com/en/ds/DS1267.pdf


Code:
'$sim  'for faster simulater ONLY

$regfile = "m16def.dat"
$crystal = 8000000
$hwstack = 32
$swstack = 20
$framesize = 40

'Disable_jtag hard code
 IN  R24, MCUCR
!SET
 BLD R24, 7
!OUT MCUCR, R24
!OUT MCUCR, R24

Clk Alias Portc.5
Dq Alias Portc.4
Rst Alias Portc.3
Config Clk = Output
Config Dq = Output
Config Rst = Output

Config Portc.0 = Input : Set Portc.0                       'Button to GND Volume UP
Config Portc.1 = Input : Set Portc.1                       'Button to GND Volume Down

Declare Sub Setvolume
Dim L As Byte , R As Byte
Dim Volume As Word
Dim Send_volume As Long
Dim Sw As Byte , Sw1 As Single
Dim X As Byte , Old_x As Byte
Const Divvol = 2.55
R = 127                                                     'volume Left ch  0-255
L = 127
Old_x = 3
Call Setvolume                                              'volume Right ch  0-255
Do
'add you code here for select input, IR RC5  ect

'Volume up  both
   If Pinc.0 = 0 Then
      If R < 255 Then R = R + 1
      If L < 255 Then L = L + 1
      Call Setvolume
   End If
'volume down both
   If Pinc.1 = 0 Then
      If R > 0 Then R = R - 1
      If L > 0 Then L = L - 1
      Call Setvolume
   End If
'(
'blance L
   If Pinb.3 = 0 Then
      If L > 0 Then L = R - 1
      Call Set_bal
   End If
'blance R
   If Pinb.3 = 0 Then
      If R > 0 Then R = L - 1
      Call Set_bal
   End If
')

Loop

' Set volume Ds1267
Sub Setvolume(byval Volume As Word)
   Volume = Makeint(r , L)
   Set Rst
   Send_volume = Volume
' Stack Select BIT 0, Bit 1-8 Pot0, Bit 9-16 Pot1
   Shift Send_volume , Left , 15
  ' 17 Bits  shiftout
   Shiftout Dq , Clk , Send_volume , 1 , 17
   Reset Rst
'Show on lcd
   Locate 1 , 2                                             'test for input select  LATER !!!!
   Lcd "DVD    "
   Locate 1 , 9                                             'show wolume in %
   If R =< L Then Sw1 = L / Divvol
   If L =< R Then Sw1 = R / Divvol
   Sw = Sw1
   Lcd "VOL "
   If Sw < 100 Then Lcd " "
   If Sw < 10 Then Lcd " "
   Lcd Sw
   Locate 2 , Old_x
   Lcd "-"
   Locate 2 , 1                                             'bargraph of volume
   Lcd "-[------------]+"
   X = Sw / 9
   X = X + 3
   Locate 2 , X
   Lcd "|"
   Old_x = X

End Sub
 
Last edited: