اطلاعیه

Collapse
No announcement yet.

حافظه eeprom

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    حافظه eeprom

    درود
    من میخوام یه شی شمار با atmega16 درست کنم که قابلیت ذخیره سازی داشته باشه یعنی با قطع شدن برق شبکه تعداد اشیاء شمرده شده ذخیره شده باشه و با وصل مجدد برق دوباره ادامه شمارش رو انجام بده،کسی هست کمکم کنه.مشکلم فقط ذخیره سازی با avr هستش که دستورالعملش و تو بسکام نمیدونم در حقیقت کار با حافظه eeprom رو بلد نیستم پروگرمر مورد استفادم هم hattel هستش.
    ممنونم از همه دوستان

    #2
    پاسخ : حافظه eeprom

    سلام
    http://www.eca.ir/forum2/index.php?topic=112967.0
    http://www.eca.ir/forum2/index.php?topic=108455.msg777842#msg777842

    دیدگاه


      #3
      پاسخ : حافظه eeprom

      منظورم استفاده از eeprom داخلی هستش دوست عزیز اگه یه مثال با بسکام بزنی خیلی ممنون میشم ازت.

      دیدگاه


        #4
        پاسخ : حافظه eeprom

        سلام. ایپرام داخلی خیلی ساده است...
        بادستور writeeeprom و دستور readeeprom می تونی توی ایپرام داخلی مقدارت رو قرار بدی و یا از حافظه دلخواه بخونی...
        این دو دستور رو توی help بسکام سرچ کن تا به جواب کاملت برسی
        *****عيب جامعه اين است که همه مي خواند آدم مهمي باشند ولي هيچ کس نمي خواهد فرد مفيدي باشد.*****
        http://electerodl.ir/forum

        دیدگاه


          #5
          پاسخ : حافظه eeprom

          بهترین منبع خوده help بسکام هستش اونطموری ک دوستمون گفت از دو دستور زیر استفاده کن:
          WRITEEEPROM var , address
          READEEPROM var , address
          اگه باز مشکلی بود بگو حلش کنیم
          من با دانش و آکاهی ام تمام جهالت ها رو به زانو در خواهم اورد.

          دیدگاه


            #6
            پاسخ : حافظه eeprom

            نوشته اصلی توسط javaad283
            منظورم استفاده از eeprom داخلی هستش دوست عزیز اگه یه مثال با بسکام بزنی خیلی ممنون میشم ازت.
            من این مثالو از help بسکام برات گذاشتم:
            کد:
            $regfile = "m48def.dat"                   ' specify the used micro
            
            $crystal = 4000000                     ' used crystal frequency
            
            $baud = 19200                        ' use baud rate
            
            $hwstack = 32                        ' default use 32 for the hardware stack
            
            $swstack = 10                        ' default use 10 for the SW stack
            
            $framesize = 40                       ' default use 40 for the frame space
            
             
            
            'first dimension a variable
            
            Dim B As Byte
            
            Dim Yes As String * 1
            
             
            
            'Usage for readeeprom and writeeprom :
            
            'readeeprom var, address
            
             
            
            'A new option is to use a label for the address of the data
            
            'Since this data is in an external file and not in the code the eeprom data
            
            'should be specified first. This in contrast with the normal DATA lines which must
            
            'be placed at the end of your program!!
            
             
            
            'first tell the compiler that we are using EEPROM to store the DATA
            
            $eeprom
            
             
            
            'the generated EEP file is a binary file.
            
            'Use $EEPROMHEX to create an Intel Hex file usable with AVR Studio.
            
            '$eepromhex
            
             
            
            'specify a label
            
            Label1:
            
            Data 1 , 2 , 3 , 4 , 5
            
            Label2:
            
            Data 10 , 20 , 30 , 40 , 50
            
             
            
            'Switch back to normal data lines in case they are used
            
            $data
            
             
            
            'All the code above does not generate real object code
            
            'It only creates a file with the EEP extension
            
             
            
            'Use the new label option
            
            Readeeprom B , Label1
            
            Print B                           'prints 1
            
            'Succesive reads will read the next value
            
            'But the first time the label must be specified so the start is known
            
            Readeeprom B
            
            Print B                           'prints 2
            
             
            
            Readeeprom B , Label2
            
            Print B                           'prints 10
            
            Readeeprom B
            
            Print B                           'prints 20
            
             
            
            'And it works for writing too :
            
            'but since the programming can interfere we add a stop here
            
            Input "Ready?" , Yes
            
            B = 100
            
            Writeeeprom B , Label1
            
            B = 101
            
            Writeeeprom B
            
             
            
            'read it back
            
            Readeeprom B , Label1
            
            Print B                           'prints 100
            
            'Succesive reads will read the next value
            
            'But the first time the label must be specified so the start is known
            
            Readeeprom B
            
            Print B                           'prints 101
            
            End
            *****عيب جامعه اين است که همه مي خواند آدم مهمي باشند ولي هيچ کس نمي خواهد فرد مفيدي باشد.*****
            http://electerodl.ir/forum

            دیدگاه


              #7
              پاسخ : حافظه eeprom

              با تشکر و سپاس از همه دوستانی که لطف کردن و بنده را راهنمایی نمودن،دوستان من یه برنامه ساده با بسکام نوشتم و اینجا میزارم اگه لطف کنید و همین برنامه رو اصلاح کنید و ببرین تو حافظه eeprom بسیار سپاسگذار میشم.
              یعنی طوری باشه که با قطع تغذیه میکرو شمارش ذخیره بشه و با وصل مجدد تغذیه میکرو دوباره ادامه شمارش رو انجام بده.
              $regfile = "m16def.dat"
              $crystal = 1000000
              Config Lcd = 16 * 2
              Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , Rs = Portb.0 , E = Portb.1
              Config Porta = Input
              Dim Q As Word
              If Porta.0 = 1 Then Goto Jam
              Jam:
              Do
              Cls
              Incr Q
              Lcd Q
              Waitms 200
              Loop
              End

              دیدگاه


                #8
                پاسخ : حافظه eeprom

                کسی پیدا نشد جواب منو بده...

                دیدگاه

                لطفا صبر کنید...
                X