Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

81%
+7 −0
Q&A How to access a hardware register from firmware?

When writing firmware in C for a microcontroller, how can I directly access a memory location such as a hardware peripheral register, given its absolute address? Is there a way to do this safely an...

1 answer  ·  posted 4y ago by Lundin‭  ·  edited 4y ago by Lundin‭

#3: Post edited by user avatar Lundin‭ · 2020-06-25T13:58:01Z (almost 4 years ago)
#2: Post edited by user avatar Lundin‭ · 2020-06-25T13:57:25Z (almost 4 years ago)
#1: Initial revision by user avatar Lundin‭ · 2020-06-25T13:27:26Z (almost 4 years ago)
When writing firmware in C for a microcontroller, how can I directly access a memory location such as a hardware peripheral register, given its absolute address?

Is there a way to do this safely and portably in standard C without using the pre-made register map delivered together with the compiler libraries?