Yet another Volume controlers and source selections - Page 26 - diyAudio
Go Back   Home > Forums > Source & Line > Analog Line Level

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 4th September 2010, 06:48 PM   #251
diyAudio Member
 
Pryanick's Avatar
 
Join Date: Nov 2009
Location: Minsk
Send a message via ICQ to Pryanick
Default $eeprom

I successfully managed with eeprom read/write procedure.
EEPROM handler is done.
Now volume, input#, outputs for bass and treble passive preamp control are store in eeprom. After powered on all these variables are read from eeprom
  Reply With Quote
Old 5th September 2010, 05:32 PM   #252
diyAudio Member
 
Pryanick's Avatar
 
Join Date: Nov 2009
Location: Minsk
Send a message via ICQ to Pryanick
Faid in on unmute bug fixed. It works fine.
Volume eeprom read/write works perfect.
There is a bug with input# read/write eeprom.
  Reply With Quote
Old 6th September 2010, 12:57 AM   #253
wabun is offline wabun  United States
diyAudio Member
 
Join Date: Sep 2009
Blog Entries: 1
Quote:
Originally Posted by Pryanick View Post
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...
  Reply With Quote
Old 6th September 2010, 01:18 AM   #254
wabun is offline wabun  United States
diyAudio Member
 
Join Date: Sep 2009
Blog Entries: 1
Quote:
Originally Posted by danzup View Post
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
  Reply With Quote
Old 6th September 2010, 03:43 PM   #255
danzup is offline danzup  Romania
diyAudio Member
 
danzup's Avatar
 
Join Date: Oct 2007
Location: Bucuresti
Quote:
Originally Posted by wabun View Post
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 .
__________________
There are not better tube than 6P3S and 6N2P for my ears !
  Reply With Quote
Old 6th September 2010, 05:01 PM   #256
diyAudio Member
 
Pryanick's Avatar
 
Join Date: Nov 2009
Location: Minsk
Send a message via ICQ to Pryanick
Default $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?
  Reply With Quote
Old 8th September 2010, 12:57 AM   #257
wabun is offline wabun  United States
diyAudio Member
 
Join Date: Sep 2009
Blog Entries: 1
Quote:
Originally Posted by Pryanick View Post
........
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..
  Reply With Quote
Old 8th September 2010, 05:15 AM   #258
diyAudio Member
 
Pryanick's Avatar
 
Join Date: Nov 2009
Location: Minsk
Send a message via ICQ to Pryanick
Default $eeprom

A bug with input# eeprom read/write was fixed.
Now input# and volume level eeprom read/write procedures are work fine.

Last edited by Pryanick; 8th September 2010 at 05:18 AM.
  Reply With Quote
Old 8th September 2010, 09:12 PM   #259
Leon08 is offline Leon08  Germany
Banned
 
Join Date: Sep 2010
Location: at Home
Hi, danzup.
You are good man.Maybe you have also some experience with pic's or Jal programing language?
  Reply With Quote
Old 11th September 2010, 03:20 PM   #260
diyAudio Member
 
FarmTech's Avatar
 
Join Date: Mar 2010
Location: Hjørring Denmark
Send a message via MSN to FarmTech Send a message via Skype™ to FarmTech
Hey

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

Quote:
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 by FarmTech; 11th September 2010 at 03:38 PM.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
source selector / volume hum in Aikido cbutterworth Tubes / Valves 1 28th March 2007 07:34 AM
Source for volume knobs? Alois Pass Labs 4 3rd July 2005 05:12 PM
IC Controlers for Class D Power stage frozenpod1 Class D 14 17th May 2005 03:25 PM
Swichable source and volume pot. Whats the best way? sounder Chip Amps 2 22nd September 2003 06:29 PM
detented volume pots... source? Mach_Y Parts 2 1st June 2003 05:23 PM


New To Site? Need Help?

All times are GMT. The time now is 12:07 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2