dennisg Posted July 12, 2012 Share Posted July 12, 2012 I am now on the learning curve for C coding on the PPMAC. I would like to access I/O memory that I believe the ACC84E occupies. Mainly the raw data coming in from a Renishaw BiSS encoder. In script this is defined as Sys.piom + $A00000; // address of lower 24 bit Sys.piom + $A00004; // address of upper 8 bits How can I access these using C ? Link to comment Share on other sites More sharing options...
Sina.Sattari Posted July 12, 2012 Share Posted July 12, 2012 You should be able to do the following: int *LowerWord, *UpperWord; int EncoderValue; LowerWord = (unsigned*)((unsigned)piom+0xA00000); UpperWord = (unsigned*)((unsigned)piom+0xA00004); EncoderValue = ((*UpperWord&0xFF)<<24)|(*LowerWord); Link to comment Share on other sites More sharing options...
dennisg Posted July 13, 2012 Author Share Posted July 13, 2012 You should be able to do the following: int *LowerWord, *UpperWord; int EncoderValue; LowerWord = (unsigned*)((unsigned)piom+0xA00000); UpperWord = (unsigned*)((unsigned)piom+0xA00004); EncoderValue = ((*UpperWord&0xFF)<<24)|(*LowerWord); Thanks Sina, I am also trying to debug this user servo routine but I don't think the breakpoints are working or I am using the debugger incorrectly. I entered it in the servo table and I know it's running because I can set a watchpoint on a Motor variable that I am incrementing inside of it. Link to comment Share on other sites More sharing options...
Sina.Sattari Posted July 13, 2012 Share Posted July 13, 2012 dennisg, The user servo routine is running in real time kernel and is being called every servo interrupt. You wouldn't expect for us to be able to interrupt and interrupt, correct? May I ask what you're trying to do in your user servo? Link to comment Share on other sites More sharing options...
dennisg Posted July 13, 2012 Author Share Posted July 13, 2012 dennisg, The user servo routine is running in real time kernel and is being called every servo interrupt. You wouldn't expect for us to be able to interrupt and interrupt, correct? May I ask what you're trying to do in your user servo? Not breaking in an interrupt context makes perfect sense, had not thought of it that way. Right now I am just trying to become familiar with the Delta Tau architecture and environment. Quite a bit different from embedded controls programming I have done in the past. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts