03-16-2010 10:50 AM
Hi.
I'm experimenting with LV2009 + Embedded module for ARM (also 2009 version).
1) What actually works, some VIs I made (not provided examples):
- infinite loop + LED blinking + 200ms wait timer
- infinite loop + current iteration number on LCD + 200ms wait timer
2) The demos provided in <LV>/examples/lvemb/ARM/LM3S8962 (DIO,PWM,Blinky,OLED) sistematicaly fail. Ex: DIO builds, but throws an exception when downloaded on the dev. boad and run; PWM fails to build (not a filled.ctl or update.ctl missing file issue, I fixed that) - something related to a PID subVI. What am I doing wrong here? Any help? (Note: I also changed the debugger & programmer settings for the uVision project, the default ULINK2 fails of course).
3) PWM EIO problem: I took the first VI mentioned at (1) above (LED blinky) and added a PWM5 EIO, in the same loop.
- what is the value wired to the PWM EIO node supposed to mean? Duty cycle 0 to 100? Duty cycle 0 to 1? Number of clock ticks for PWM high state? Sometimes it worked, sometimes the PWM was on logic high all the time.
- if I add a PWM5 EIO property node and try to set anything, the whole thing breaks. From what I saw in the uVision debugger, it gets stuck in the default interrupt handler section. I cannot figure out how it got there.
Please help me with a tested working example of how to completely set up a PWM EIO, with control over frequency, duty cycle, everything.
Thanks in advance for your time&help.
Paul.
Solved! Go to Solution.
03-16-2010 04:01 PM
Simple VI with a stacked sequence:
1) set PWM1 frequency to 2000 (EIO property node w/ constant 2000 wired)
2) set PWM1 duty cycle to 25 (EIO node w/ constant 25 wired?)
3) infinite while loop
Everything is default, except I changed the debugger&programmer to "Luminary".
I debugged more thoroughly and the result is:
- processor defaults to "Startup.s" -> ResetHandler (as expected)
- "IMPORT __main" -> OK
- "IMPORT SysCtlClockSet" -> OK
- clock/oscillator setup
"LDR R0, =0x01C00380
BL SysCtlClockSet"
-> OK
- "B __main" -> fails; program gets stuck to
"FaultISR
B FaultISR"
Any ideea? I thought it was stack-sequence related; but it happens if I place the 3 pieces of code on the diagram without a sequence too.
At this point, I`m beginning to think that NI rushed the release of the ARM module? ... Any help is most welcome!
PS: Any advice on how to use a timer in capture mode, with clock from an external source, in LV ARM?
03-17-2010 02:48 AM
Hi.
A screenshot is worth 1000 words, so:
1) works very nicely ...
2) fails ( FaultISR ) ...
Same compiler/project settings for both cases, of course, the defaults shipped with LV ARM.
What am I missing here?!?!?
03-17-2010 09:21 AM
More detailed info, from the debugging tools in uVision: the problem is a Bus Fault. BUS_FAULT_ADDR:0x40028040; BUS_FAULT_START:0x82. PRECISERR is checked, and also Hard Faults > FORCED is checked. May be useful info for someone trying to help ...
Thanks!
03-17-2010 04:40 PM
Hi Paul,
I have been looking into your questions, but have yet to be able to reproduce any of the errors you describe. I am continuing to investigate and will let you know when I have more information.
Regards,
03-18-2010 01:31 PM
So does this mean that you succeeded to output, let's say, a 3kHz PWM on PWM5?
Another update: I tried placing just an inline C block in the VI, with nothing else. The code in the C block is the same provided as example with the LuminaryMicro peripheral driver library, that is actually behind LV ARM for LM3S8962. Same results, bus addressing fault. Does not cause any problems when using the uV simulator, just on the actual hardware target. Any of the examples provided with the LuminaryMicro library (as uVision projects, written in C) work, so it is not the device that is faulty.
Thanks for your time,
Paul
03-18-2010 05:11 PM
Hi Paul,
This looks like an issue where you (or rather LabVIEW generated code) are configuring the PWM peripheral before enabling the peripheral. The target will fault in this case, but the simulator will not. Because the PWM EIO node initializes and enables the PWM peripheral, if the EIO property node is executed before the EIO node, the target will fault. Try using a sequence structure to ensure the PWM EIO node executes before the property node.
03-19-2010 02:29 AM
I agree, but that still doesn't solve the case where I only use a C node with the exact same code that works perfectly in a stand-alone uVision project...
Will try this trick in LV though. Supposed it works, this only leaves me with my next great dillema: how to use two of the timers in edge-to-edge externally triggered capture mode 🙂
03-21-2010 04:01 AM
Thanks vansick!
In what I'd call a highly counter-intuituve fashion, it worked. Flat sequence, 1st start the PWM, 2nd set PWM properties, 3rd infinite loop.
This leaves me with my timers problem mentioned above. Any help would be great.
03-22-2010 11:39 AM
Hi Paul,
Please start a new thread for your latest question. That will make it easier for others with the same question to find it.
Thanks,