I have setup the Flexbus to read from a 16bit ADC. I am using AD0-AD15 and one chip select (CS1). I don't mind that it is multiplexed because I was thinking the RD line would just get the data at the correct part of the read cycle.
I am using Processor Expert.
I set the Flexbus up with a base address of ox60000000.
PE Automatically enables the clock to the FlexBus, or so it seems.
When I attempt to read with something like:
uint16Val = *((uint16 *)0x60000000)
or
uint32Val = *((uint32 *)0x60000000)
I get a bus fault. I can't figure out what I am doing wrong. Please Advise!!!
update..
I found that the K70 Ref Manual depicts 0x90000000 as an external FlexBus memory area. Not 0x60000000 as the P.E. allows. Also, apparently 0xA0000000 is available as a slave device area.. not executable.
I checked the SIM registers and indeed the FlexBus is being clocked at 30Mhz and the clock gate is ON.
Still.. no matter what I do I can NOT acces the Flexbus address range without a Bus Fault.
Still in dire need of help on this. So frustrating that I can not get ANY repsonses to my posts here. I attempted to get a Freescale tech support person over the phone as well. I may just have to switch to a different processor with better support. All three of my current projects were based on the K70 / K20 devices but this isn't funny.
Have you tried doing a search on this board using "flexbus"? There have been a number of threads covering Kinetic Flexbus issues.
---Tom
ha! Yeah.. for 2 days. There isn't a single post on the internet regarding the FlexBus that mentions Bus Faults related to CS1. Not Anywhere. I think there is only ONE regarding the FlexBus and Processor Expert
Thanks though.. gave me a chuckle. ! Duh.
I still need an answer to this but I found that by clearing the bits in GROUP1's register of the FB_CSPMCR the fault would stop occuring . Using the same base address and memory block for the other chip selects did NOT yield a bus fault then attempting to access the bus. That can't work though because it sets the multiplexing for CS1 to FB_ALE.
Would have been nice to get some help from Freescale on this one. But not a peep.
UPDATE:
Freescale says you must have CS0 enabled no matter which other CSx you are using or you will get a bus fault. I couldn't find that documented. Perhaps you pros know that or understand it as a result of other parts of the architecture but it was a very helpful note from Freescale.
Still trying to determine, though, if I can attach a 16 bit device to the FlexBus and acquire 16 bit shorts with single reads form the device. THis is a 6 channel ADC which increments its internal buffer pointer with each _RD signal. I think the Flexbus is reading 16 bits as two bytes though I don't have BWEs enabled. Still working it..
thanks!
Thanks! One of the firsts post I read 3 days ago. Not related to my problem. That coder was using the wrong cast to access the port. I saw everything there is online. Everything.