Wednesday, July 24, 2013

Raspberry Pi Basic Setup

I wanted to make this post as a reminder of the steps I took to setup my raspberry pi.

if you don't know what is Raspberry Pi, just head to http://www.raspberrypi.org/.


---- Installing the Linux Distro ----

Lets begin with the very basic, downloading and installing a Linux distro into our pi

I recommend using the Raspbian "Wheezy" as a starting point.

Raspberry pi download page: http://www.raspberrypi.org/downloads

Once you get the distro file "img" you need a little program to load it into a SD card, there are many out there but I like to use: win32disk imager

You can download it from: http://sourceforge.net/projects/win32diskimager/

---- First Commands ----

The first thing I like to do is enable SSH

you can do this by running this command:
sudo raspi-config
and enable ssh as shown in the next figure.



once SSH is enabled, you can login to your pi remotely using Putty or any other Telnet/SSH client

Other useful command I like to run the first time I boot up onto my pi is:

sudo apt-get update
sudo apt-get upgrade
this will ensure that I have all the packages up to date.


---- Installing a Graphical Remote Desktop Connection ----

From time to time I like to use a graphical interface to do some task. One way of doing this is using a Remote Desktop Connection.

First install Tight Vnc Serve by running this command.
sudo apt-get install tightvncserver
after installing the Tight Vnc Server, you can run it manually every time you need it (using ssh) with this command
vncserver :1 -geometry 1600×900 -depth 16 -pixelformat rgb565: 
and after you have finished using it, run
vncserver –kill :1
 to kill the server and stop using any resources.

There is also a way to fire up Tight Vnc Server every time the pi boots, head to the link below for more details.

Source: http://www.howtogeek.com/141157/how-to-configure-your-raspberry-pi-for-remote-shell-desktop-and-file-transfer/all/

---- Installing Git ----

Git is a great service for cloud source control, you can install it in you pi running the following command.
sudo apt-get install git

---- Installing GPIO Drivers ----

If you want to use the gpios you have in your pi, you will need to install the gpio drivers.
sudo apt-get install python-dev
sudo apt-get install python-rpi.gpio


---- Enable SPI and I2C module ----


edit file: sudo nano /etc/modules
verify this lines are in the file
snd-bcm2835
i2c-bcm2708
i2c-dev

On the file:
sudo nano /etc/modprobe.d/raspi-blacklist.conf

Comment out
#blacklist spi-bcm2708
#blacklist i2c-bcm2708
to enable both modules



---- Install SPI Drivers ----



git clone git://github.com/doceme/py-spidev
install py-spidev by navigating to /py-spidev folder and
sudo python setup.py install

---- Install Uart Drivers ----

sudo apt-get install python-serial

Broadcom peripherals datasheet:


---- Utilities ----

RPi Monitor

Backup your SD card

WebIDE

installation
issue

---- Some Useful Drivers ----

Some raspberry pi python drivers

RPi.GPIO documentation
RPi peripherals

Wednesday, February 1, 2012

Sort and Prioritize an Array of Clusters in LabVIEW


Problem: We have an array of a determinate cluster with different types of data. And we want it to sorted using an specific criteria, but that criteria is not only one field, but several fields in order of priority.

Solution: I guess there should be plenty of solutions to solve this problem, (please leave you comment about how you will do it) but I found this one quite easy to implement and to maintain afterwards. So before anything, lets crack on on the method.

Figure 1 shows the LabVIEW front panel containing the input Array with 4 different fields (2 integers 1 double and 1 string), Also showing the output array once sorted out.



Figure 1: Front Panel
Figure 2 Shows the LabVIEW Block Diagram, We start with a for loop to get each cluster from the array, we unbundle by name that cluster and bundle it again, but this time, specifying the order criteria we want. in this example we want Field 2 as the top priority then Field 1, Field 4 and last Field 3, note that doesn't matter the data type, it till be sorted out at the end. 

Once we bundle we output this new cluster with indexing enabled (this will create a new 1D array). Then we use the sort 1D array function to actually do the sorting process.

Here you have to choices, if the cluster is not a custom control, meaning that you don't care the appearance or other attributes, you can use the output of the sort 1D array as your final output.
But if you indeed had a custom control as your input, you need to convert it to. using the unbundle and bundle within a for loop the last one using as a prototype your input cluster you will have your same input cluster but now completely sorted with your given priority.
Figure 2: Block Diagram
Please leave in the comments section if you have used this example in you project, or any other questions you might have, I will be more than happy to help you.

Cheers

Thursday, April 14, 2011

Better Wait VI

This little Labview Code add a better way to wait since you can wait on previous VI linked trough the error.

 

If you have any questions, just leave a comment and I will post them here.

 

 

 

Saturday, April 9, 2011

Crystal accuracy: PPM parameter

Manufacturers usually provides the accuracy or stability of the crystals as a PPM value which basically means how many pulses per million the crystal might drift from the central frequency.

To convert this value into how much hertz this crystal can drift, we can use the following formula

                      F x ppm
Delta F=   ---------------------
                        1E6

i.e. if you have a 16 Mhz with a 10 ppm

                     16 Mhz x 10
Delta F=  ----------------------
                          1E6

Delta F= 160 Hz




You can use a high precision frequency counter to measure the frequency of the crystal.



Thursday, April 7, 2011

OnTest blogging?

I've always wanted to start a blog, so this is my opportunity to do
so, even though English is not my mother tong, the intention of this
blog is to reach more and more people, and of course improve my
writing skills in english as well.

I've been working for several years as a Test Engineer on the
Electronic and Semiconductor industry, and before taking seriously
this role, I was in the thought that "testing" was just a part of
developing or designing. But certainly is NOT, and assuming that many
Engineers think as I did before, the main intention of this blog is to
ilustrate why, in many ways "testing" should be taken very seriously.

Also now and then, I will post technical articles that I'll find
intersting or that might help other Test Engineers

See you soon. :)