Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Power PC - Header files?

Status
Not open for further replies.

Pheetuz

Full Member level 3
Joined
Feb 12, 2010
Messages
162
Helped
21
Reputation
42
Reaction score
19
Trophy points
1,298
Location
Brighton
Activity points
2,835
Hi Folks,

I have a module on my course that covers powerPC programming but it covers the module in assembly language, I however would prefer to do the project in C, the tutor has said that this is fine but he has limited knowledge of programming the powerPC in C.
He suggested that in order to access specific registers in the IMMR(Internal memory map register) I should set up pointers to each individual register and then I can use these to access the registers which I agree is one way to do it.
What I was hoping for was that someone would be able to point me in the direction of a header file that I could use that would allow me to access the registers using struct, union or bit field names, like you can in a PIC, for example:
Code:
 PORTCbits.RC3 = 0x1;

It would be greatly appreciated if anyone could shed any light on the matter.

Cheers,

Pete.
 

I think you should use #define PORTCbits.RC3 0x1

Look at other headers to see how it made
 

I don't get what you mean Cortex?
I could write a header file for the processor but seen as the memory map is something like 16kB I don't really fancy writing structs and unions for all of that! Just assumed that there would be something out there for me to use, alas!
 

You don't need to write for all. Write for only the things you need.
Once you need something, go to the header and define it.
 

Everything would need defining if it was going to use structures and unions in a header file as otherwise the unions would not sit over the right memory location and then I would have to use a pointer and use the structure as a cast for that pointer to use the bit field values.
I am trying to find something that will allow me to bypass doing this, as there is for other uPs.
Cheers anyway :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top