Tuesday, May 24, 2011

code generation scicoslab/scicos

c/c++ code generation from system blocks (Matlab/Simulink, Scilab/xcos, ScicosLab/Scicos) is really helpful for rapid-prototyping.

some documentation available here: http://www.scicos.org/CodeGen_doc.pdf


ScicosLab/Scicos provides (also Scilab/xcos) code-generation facility for generating a stand-alone “c” code. The generated file can be linked to various interface modules.


Create a block diagram in Scicos. Select the relevant blocks and make them as super block. And make it as super-block for code generation. Select “code generation” from the tool bar and generate the code for the super-block.



xxx_standalone.c
xxx_act_sens_events.c
libxxx.lib

where xxx is the name of the workspace.

Include these files in the visual-studio and create an executable.

Open loop response of 2nd order system:

I have given some constant input 1.0 in the “xxx_act_sens_events.c”
*((double *) y+(k+l*(*ny1))) =1.0;

Otherwise the program will be asking the input continuously for every iteration.


Ol1.txt is generated from the “generated code”
foo.txt is from the scicos generated output.

Tuesday, March 15, 2011

Beagle Board

After some struggle, I could able to boot the beagle board (version c4) with Angstrom OS.
Initially, I felt it is very difficult to test the board without the OS.

All we need: 3 wires and a USB mini cable/5v adapter : To test the board with out OS, we just need 3 wires if the correct cables are not available : ATI/everex IDC 10 cable + female to female DB9 null modem cable).
rs232 Pin out structure of beagle board:1. Connect the Rx pin of the beagle board (#2) to the Tx of the computer serial port (#3).
2. Connect the Tx pin of the beagle board (#3) to the Rx pin of the computer serial port (#2).
3. Connect the ground pin of the beagle board to the ground pin of the computer serial port (#5).

Beagle board c4 with IDC 10 cable:
The red color of the IDC 10 cable should be connected near to the pin #1. Also, the cable will have 9 holes (make a hole using a small pin).

Serial cable (Db9 female to female)

Open the hyper terminal, and configure the com#1 (usuall com#1) with 115200 baud rate and flow control: none
By using either the cables or self made configuration cables, connect the board to the serial port of the pc and power it on. Beagle board will boot with the boot loader existing in the NAND memory.

Beagle board with Angstrom OS:

The board I have is Beagle board rev c4. So, I need to make to some changes in the loader.
1. Follow the instructions mentioned in this link: http://beagleboard.org/challenge

2. Copy the necessary files (MLO, u-boot.in) and angstrom files to the SD card. I have used 1 GB SD card. Follow exactly the instructions mentioned here:
1. format instructions: http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat
2. section 2 of this : http://code.google.com/p/beagleboard/wiki/HowToGetAngstromRunning

Beagle board with Angstrom OS:

Only thing left is connecting the Beagle board to the video display. I tried connecting to a monitor using HDMI male to DVI female + DVI female to VGA. But didn't work.

Update: Luckily I found dvi male to male converter and dvi monitor. Connected the board to the dvi monitor:

Here is the beagle board c4 with angstrom OS:
Booting phase:


Angstrom OS:
Still keyboard, mouse are not connected. May be USB port needs a powered USB hub. Will update it soon.

Thursday, March 03, 2011

more on Kindle

I have been using for a while (finished reading one Novel).

1. it is good and nice to read a hard-copy. it is quite boring to read the whole world on a slate always. it is obvious that we will get a feel with a new book always.
2. reading news is really a boring thing on Kindle.
3. updated the kindle software, but still not getting the page numbers for kindle based content. (may be, not updated for the novels, i bought).
4. people around me are still thinking that i am holding a gadget. so my wife throws it whenever i am holding it all the time. she doesn't say anything if i hold newspapers, books all the time. (see the real difference).
5. i can not use it anywhere i want (what if it fells down from my hand). but you can read a hard-copy book wherever you want.

so, better buy an ipad kind of a device.

Thursday, February 24, 2011

Reactive

Some times I used to watch people's behavior crossing the roads. They walk slowly with great confidence in them. Like, "the driver will be killed if I am hit". isn't it funny.

/Srinivas

Wednesday, February 23, 2011

Stirrer

I surprised my wife with a gift. She is also very much surprised after looking at. (she thought it must be some kind of gold jewelery).

I presented a plastic stirrer (during flight journey I was served a drink with a stirrer). I kept it in my pocket without throwing it into the dustbin.

Whenever I go to hotel with my wife, she always asks me to steal the stirrer served with the drink. I have no courage to do that simple stupid thing for my wife.