Q about C for 56800 family

Status
Not open for further replies.

djolestojic

Member level 5
Joined
Dec 9, 2001
Messages
85
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
508
How can one write/read peripheral registers in DSP56800 family, by using only C instructions.

θχαηκΣ
 

You have to define all registers as pointers at tehe begining of the C code, for exameple:

#define SCRRX (int*)0xFFD4 //; SSI Receive Control Register
#define SCRTX (int*)0xFFD3 //; SSI Transmit Control Register
#define SCR2 (int*)0xFFD2 //; SSI Control Register 2
#define STX (int*)0xFFD0 //; SSI Transmit Register
#define SRX (int*)0xFFD0 //; SSI Receive Register
#define SSR (int*)0xFFD1 //; SSI status register

And to read or write the register you have to refer to itself like:

*SCRRX = 0x6F04; //PSR=0, WL=3, DC=15, PM=4
*SCRTX = 0x6F04; // PSR=0, WL=3, DC=15, PM=4


hope it may help...
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…