The Raspberry Pi is a device involving the Broadcom controller chip that is a SoC (System on Chip). Their SoC has a strong ARM11 processor that is based on 700MHZ at its core. With the enhanced peripherals such as timers, interrupt controller, GPIO, PCM / I2S, DMA controller, I2C, SPI slave, PWM, UART, USB, graphical processing unit (GPU) which includes VideoCore, MPEG-2 and MPEG-4, 512 MB SDRAM this can be considered as a mini-computer.
Even the cheapest board like the Raspberry board can support big operating systems such as Linux, MAC, and WINDOWS. Above all, for any kind of programming and development, the Linux operating system especially Ubuntu is preferred. Operating systems such as the Archlinux ARM, OpenELEC, Pidora, Raspbmc, RISC OS, and the Rasbian and Ubuntu versions are obtainable for the Raspberrypi board. The apparent benefit of running an Operating System such as Ubuntu on an embedded system device such as Raspberrypi is the ability to have Multiple Users and Multiple Tasks.
In this project, the Raspberry board is loaded with Ubuntu, and for ease of controlling remote VNC is used. Internet is also ably connected to the Raspberry board. By establishing an assessment of the connector port of the Raspberry board, it can be easily found that there are 26 connectors available. All the connector pins are removed by using female connectors which are 13*2 pins and at the other terminals of their wire, 26 pins Burg stick male connectors are connected. The Burg stick male connectors enable every pin out of the Raspberry board to be poked into the holes on a breadboard. To write to the pin or read from the pin that is coming out of the Broadcom controller of the Raspberry board using C language there is a C library available and that is “bcm2835” that has been downloaded and installed.
A signal is raised to provide information to the process that some event or condition has taken place that warranted its attention. The signals are utilized to announce different events and all the signals are characterized by their numbers. The complete list of all the signals available in the OS and their corresponding signal numbers can be known by using the following command.
kill -l
The following table gives a list of the most common signals that a process might encounter in an Operating System;
NAME | NUMBER | DESCRIPTION |
SIGHUP | 1 | Linux sends a process this signal when it becomes disconnected from a terminal. |
SIGINT | 2 | Linux sends a process this signal when the user tries to end it by
pressing CTRL+C. |
SIGILL | 4 | Linux sends a process this signal when it attempts to execute an illegal instruction. |
SIGABRT | 6 | Linux sends a process this signal to the process when the process calls the ‘abort ()’ function |
SIGFPE | 8 | Linux sends a process this signal when it has executed an invalid floating-point math instruction |
SIGKILL | 9 | Linux sends a process this signal to end it immediately |
SIGUSR1 | 10 | User programs can send this signal to other process |
SIGUSR2 | 12 | User programs can send this signal to other process |
SIGSEGV | 11 | Linux sends a process this signal when the program has attempted an invalid memory access |
SIGPIPE | 13 | Linux sends a process this signal when the program has attempted to access a broken data stream, such as a socket connection that has been already closed |
SIGALRM | 14 | A process can receive this signal from the Linux using the function alarm(), after a time period mentioned in its argument. |
SIGTERM | 15 | Linux sends a process this signal requesting it to terminate |
SIGCHLD | 17 | Linux sends a process this signal when a child process exits |
SIGXCPU | 24 | Linux sends a process this signal when it exceeds the limit of
CPU time that it can consume. |
SIGVTALRM | 26 | A process can receive this signal from the Linux using the function setitimer (), after a time period mentioned in its argument. |
This particular project is based on continually being informed of and processing the signal number 14, the previously mentioned SIGALRM. A process gets the SIGALRM signal from the OS by using a function called ‘alarm ()’ and the function for its definition is found in the header file ‘<signal.’ h>.
Then the OS will send the SIGALRM to the process next to the period mentioned in the parameter that has been passed while calling the function. SINGLE will handle only a single call to the alarm () and will respond to it with a single SIGALRM signal only. For the reception of SIGALRM at a continuous interval of time, the same function has to be called after every reception of SIGALRM. The better method, therefore, would be to take advantage of setting a timer, which can proceed to generate the SIGALRM signals in intervals of time.
The ‘set interval timer’ function can be used to set a timer which can continuously generate the SIGALRM signals at specified intervals of time.
bcm2835_close();return 0;}void timer_seconds ( long int seconds ){struct itimerval timer1;
For mroe detail: How to Use Timer in Raspberry Pi