Friday, March 26, 2010

Mar.26& Apr.2 Blinky with LtSensor.led etc

Using LEGO HW:
1. Create and export FB types via normal way:
  • 4diac-ide Types
  • export to Forte using 0.4 export filter
  • edit C++ code for SI FBs 
2.  openocd-FLASH.bat
3.  openocd.bat
     know finished when:
  • the LMS boot blinking finished 
  • the PC sounds indicate new HW connected
4.  run from eclipse java
5.  4diac-ide deployment (check and download)
     (not launch!)


Tested and working with:
  • Alex's blinky unchanged
  • Alex's blinky with shorter delay times
  • In Alex's System: New Application: Test1LedOff with 1 LMS_LED (discovered 1=turn off) 
  • In LegoHW:  OffLed changed new LtSensor.led FB so 0=turn off
Next:
  • In LegoHW: in LtSensor.led FB use input PORT
  • Note: #define macros are used to shorten for hw access. The macros refer to lower level macros. The highest level macro used had port# in its name, so used #define macro 1 level down where the port # appears as a number.

Currently getting:

end Mar.26 
Error: Vref too low. Check Target Power
Even after trying: 
  • a different fully charged battery pack  
  • leaving charger plugged in 
but after continued tries, it appeared to be get further before failing - so will try again after plugged in a while.

Apr.2 works: 
Suspect problem was the PC was confused if LMS is USB or something else.
Next time problem occurs need to try openocd-flash.bat after each of the following:
(not sure which one cleared the problem):
  • Plugged in a USB memory stick and disconnected it.
  • Unplugged/plugged in the LMS USB cable and went to control panel to install new HW. When clicked on it - said this id is not autorized.
  • Tried openocd-flash.bat and it worked.
The broken pipe problem occurred when Alex was showing me what to do. He also had to try various things to get it to work again. Did we plug in an USB stick at some point to save something? Maybe.


Important Design Problem: Use 1 instantiation when only 1 physical object or when reading or writing you have to be aware of state changes.

Seems obvious, but easy to use  more when "hidden" in a Composite FB
Ex: an application that uses composite FB - for example lineboundary or calibrate before line1 (very simple line follower).

No comments:

Post a Comment