Hallo, wie kann man denn auf eine bestimmte Stelle im RAM schreiben? Ich benutze C als Programmiersprache und den Chip CC2530 von Texas Instruments mit der 8051CPU. Mein UserManual sagt, dass ich zum Nutzen eines bestimmten features (source matching algorithm) die notwendigen Werte ab der Adresse 0x6100 im RAM schreiben muss: "Source address matching is only performed when frame filtering is also enabled and the received frame has been accepted. The function is controlled by: • The SRCMATCH, SRCSHORTEN0, SRCSHORTEN1, SRCSHORTEN2, SRCEXTEN0, SRCEXTEN1, and SRCEXTEN2 registers • The source address table in RAM The source address table begins at address 0x6100 in RAM. The space is shared between short and extended addresses, and the SRCSHORTEN0/1/2 and SRCEXTEN0/1/2 registers are used to control which entries are enabled. All values in the table are little-endian (as in the received frames)." Ich habe leider nicht all zu viel Erfahrung mit µControllerprogrammierung und weiss nicht, wie ich auf die bestimmte Stelle zugreifen soll. Danke
Also im allgemeinen kannst Du mit *(volatile uint8_t*)Adresse auf des Byte unter Adresse zugreifen, also z.B.
1 | *(volatile uint8_t*)0x6100 = 123; |
Oder mit #define
1 | #define SRCMATCH *((volatile uint8_t*)0x6100)
|
2 | SRCMATCH = 123; |
3 | uint8_t tmp = SRCMATCH; |
MfG Mark
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.