- LiTime Speicher und Akkus         
Ergebnis 1 bis 4 von 4

Thema: Daten von RS232 einlesen und dann in EEProm?

  1. #1
    Neuer Benutzer Öfters hier
    Registriert seit
    10.10.2004
    Beiträge
    9

    Daten von RS232 einlesen und dann in EEProm?

    Anzeige

    LiFePo4 Akku selber bauen - Video
    Hallo Leute

    ich habe folgende Frage:
    Kann man (ATMEGA162) über die RS232 Daten einlesen und mit
    Bascom dann diese Daten dann Spannugsausfallsicher im EEPROM
    schreiben.
    Sozusagen eine Parameterliste via RS232 an den Chip schicken, mit
    der dann gewisse Funktionen ausgeführt werden.

    Danke senti

  2. #2
    Erfahrener Benutzer Roboter Experte
    Registriert seit
    10.08.2004
    Ort
    Großbardorf
    Alter
    36
    Beiträge
    674
    ich denke schon, dass das geht
    du brauchst die Befehle von Bascom für RS232 und EEPROM und dann dürfte das kein Problem sein

  3. #3
    Erfahrener Benutzer Robotik Einstein
    Registriert seit
    09.06.2004
    Ort
    Aachen
    Beiträge
    2.674
    Falls es dir weiterhilft, wenn du in der BAscom-Hilfe writeeeprom eingibst, findest du folgendes Sample:

    Code:
    '-----------------------------------------------------------------
    '                        EEPROM2.BAS
    '   This example shows how to use labels with READEEPROM
    '-----------------------------------------------------------------
    '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
    '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 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
    
    
    End
    MFG moritz

  4. #4
    Gast
    cool danke genau diese Info brauchte ich.

    senti

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

LiFePO4 Speicher Test