Wednesday, September 15, 2010

Sept.15 PNP built

PNP model (Lego Bonus Model #4)  that will be used as starting point for the 3rd tutorial has been built. Took 4.5 hours over 2 days (3+1.5). 


Thursday, September 9, 2010

Sept.9 LineFollower Video

After creating an E_SPLIT4 to send events to both motors, led indicator, and light sensor reader,  
the Simple Line Follower using forte 3.x works. It follows a straight line and curves in one direction. There may still be memory issues, but they take longer to show-up!

I forgot to unplug the USB cable and it kept following the line after being unplugged!



Forte IEC61499  LF1 Application:


Tuesday, September 7, 2010

Sept.9 Line Follower now

Wanted to just run the line follower and make a video.
But doesn't work because of changes documented here. 
This is typical since the FBs for Lego NXT are not stable and there is too little space for FORTE.

1.  To save space in FORTE the  HYST_UINT and calcBnd FBs were commented out in the src/Makefile.am Too bad can't connect the application XML and FB makefile.

2. Names were shorten to fit in space available, but changed to longer names for documentation.  Must be changed back.

3. Motor FB was updated to add STOP event.

4. Seeing if changing to -O2 helps

Still doesn't work... so more to come
At least one problem was the JTAG cable connection

Sunday, September 5, 2010

Sept. 5 Media Wiki started

One goal of this blog was to avoid having to ask the same question twice. But as I learn the same topic comes up multiple times, each time with more depth. So information is scattered over time or blog entries are no longer date related.  

To solve this problem and provide a place to work on the (formal) tutorials, a media wiki has been started.  For better or worse this media wiki is not online. It uses MoWeS Portable, so it is a Wiki on USB stick.

So far the tutorial outlines are in place with more details for Tutorial 1.

Wednesday, August 25, 2010

Aug.25 Timer Counter

Next Step: See exactly what code examples use
and understand what eCos wants to do for an application.

Following are notes / summary of my understanding of ARM7 Timer Counters from:

Color code: HighLevel; Register; Bit

TCs can be pgmd to:
  1. freq measurement
  2. **event counting (like lms motor tacho count)
  3. interval measurement
  4. pulse generation
  5. delay timing
  6. pulse width modulation 
  7. interrupt generation
Each channel has:
  • 3 external clk inputs=
  • 5 internal clk inputs= TIMER_CLOCK1-5; MCK/2 8 31 1128 1024
  • 2 multi-purpose i/o signals=
  • 1 internal interrupt signal = 33-2 Channel signal
  • (can be pgmd to generate processor interrupts
with
2 Operating Modes= DS p.444 / p.2 ApplNote 
  • Capture Mode  (measurement on signals) 
    • TIOA always output
    • TIOB 
      • usually output
      • can be selected as external trigger
  • Waveform Mode (wave generation)    
    • WAVE bit (=?) in TCx_CMR 
Triggers
3 common to both modes:
  • Software
    • set SWTRG bit in TCx_CCR
  • SYNC signal asserted. 
    • Asserted same time for all 3 channels 
      • "by writing TC_BCR (block cntl) with SYNC set(?)"
  • Compare RC Trigger
    • triggers "when counter value matches the RC value if CPCTRG is set in TCx_CMR
    •  (Does this relate to lms Schmitt trigger?)
1 external trigger (per channel)
  • in Capture Mode:
    • selected via TIOA and TIOB
  • in Waveform Mode:
    • Signals that can be programmed on
      •  TIOB
      •  XC0, XC1, XC2
    • External event triggered by setting ENETRG in TCxCMR
    • *Duration of pulses must be longer than the system clock (MCK) to be detected.

Clock Source

Timer Interrupt Generation

Tuesday, August 24, 2010

Aug.23 Interrupt never invoked?

Why is interrupt not called? 

Easiest to correct:
  • priority is too low
Since not comfortable with what eCos does and what is left to do likely...
Either:
eCos call to isr (interrupt service routine) 
  • match documentation?
  • match the structure of i2c working interrupt call
or
Commands to ARM7 to allow the interrupt are not fully correct.
  • check documentation
  • compare to examples of working code
  • via debugger check memory is really what expect

Monday, August 23, 2010

Aug.23 arm-elf-insight use

Revisiting /redocumenting debugging with arm-elf-insight because:
cygwin doesn't keep history between sessions anymore on lab PC, and found early debug description in March is missing details, as well understanding the process better now.
 
Created simple script, so don't have to remember a long path name to forte:

lmsdb.sh:
cd /cygdrive/d/AA_local/eclipseWork/forte_lms_neu/bin/lms/src
arm-elf-insight /cygdrive/d/AA_local/eclipseWork/forte_lms_neu/bin/lms/src/forte

0. flash lms with fw code updates (flash.bat or Sam-ba)
1. start openocd.bat 
in cygwin:
2. when lms is initialized (blinking led stopped), start arm-elf-insight using
./lmsdb.sh
3. In arm-elf-insight:
  • connect to target 
    • remote tcp with port 3333    (for Raven JTAG != 3333 for example: 8888)
  • in (view) console:
    • monitor halt
    • monitor reset
  • select (view) breakpoints
    • 1 breakpoint only if want to step
    • 2 breakpoints max.
    • for Raven montitor set hbreak 0xaaaaaa
      • where 0xaaaaaa is address from breakpoint window
4. continue
5. start usb connection
6. start application and wait for the breakpoint to be reached


Miscellaneous Notes: