Hi All,
I'm doing a project using a TWR-MPC-5125 module with some external 8 bit devices connected to the localPlus bus (via the card edge connector) and am wondering about the "proper" way to perform reads/writes to those devices using MQX (3.8). At this point I'm just planning to directly access the processor registers for the LocalPlus Bus Controller (LPC) and configure the address windows, chips selects, etc that I need and then read write my devices using pointers. I'm just wondering if this is the best way given that I'm using MQX or if MQX has functions to do any of this? Any suggestions, research guidance, etc would be appreciated, thanks!
Best Regards,
Tim
Solved! Go to Solution.
Hi David,
Thanks for your reply, I''ll give the IO drivers doc another look. I do have a functional LocalPlus Bus at this point and I did it by directly configuring the LPC registers in the processor. Some of my initial problems were caused by a typo in the Freescale Microprocessor manual for the 5125 that set the wrong base address for the LPC registers. Once that was sorted out the LocalPlus bus was pretty simple to configure and use. I will publish a note here in the week or so on the steps required and the proper value for the LPC_BASE register.
~Tim
Hi Tim,
Please have a look at the MQXIO.pdf in the MQX3.8/doc/mqx path.
This PDF has many chapters on drivers. The Chapter 6 Simple Memory Driver might work for you.
Regards,
David
Hi David,
Thanks for your reply, I''ll give the IO drivers doc another look. I do have a functional LocalPlus Bus at this point and I did it by directly configuring the LPC registers in the processor. Some of my initial problems were caused by a typo in the Freescale Microprocessor manual for the 5125 that set the wrong base address for the LPC registers. Once that was sorted out the LocalPlus bus was pretty simple to configure and use. I will publish a note here in the week or so on the steps required and the proper value for the LPC_BASE register.
~Tim
HI Tim,
I just started using MPC5125 tower and I wonder if you post the note you've mentioned about LPC configure? I couldn't find it...
thaks
Mario
Hi Mario,
I never did post the note. I'm attaching a text file to this post with the function that I wrote to config the LPC for my needs on the MPC5125. Note that I call my functions REGIO_RegWriteByte() to write byte registers and REGIO_RegWriteWord() to write 32 bit word registers. First passed param is the write address offset from IMMRBAR_BASE, next is the data to write and last is an option to reverse the bit order of the written data (big endian, little endian thing). You should be able too lookup the registers I'm configuring (notes give page numbers in the uProc Manual) and see what I'm doing then modify as required for your use. I never did find an "MQX" way of doing this but my way seems to work well. Hope this helps.
void REGIO_RegWriteByte(uint_32 lOffset, uint_8 cByte, uint_8 cReverse)
void REGIO_RegWriteWord(uint_32 lOffset, uint_32 lData, uint_8 cReverse)
Best Regards,
Tim Hutchinson
Hi Tim,
I just download your txt file...
Thank you very much...
Mario
Thanks Tim for update and using the Community.
Sorry for the typo.
Regards,
David