SBC9302

, , , February 1st, 2008

We received the SBC9302 a week back. The box had the board, a serial cable, a cd with development software and manuals, and a voltage eliminator for the board.

Linux was pre-installed and all we had to do was to use the serial RS232 cable to connect the board to the computer, then use Minicom (or HyperTerminal in Windows) to boot the embedded OS and get a terminal from it. We tried it and it worked perfectly. We got a terminal and most Linux commands worked. And the entire installation was not bigger than 8MB!

Next job was to try downloading programs onto the board and execute them. But to do that, we have to create a new OS image that has our program and then download it to the board. Atleast that was what the manual said. We tried compiling the code, but we had quite a few problems with that. None of us has done this before.

That was when this idea struck me. The manual says that the OS automatically mounts USB storage devices connected to the board. So we could use a thumb drive to connect and transfer our binary to the board. We wrote a small PID controller that has a simulated process on the desktop, so that it would compile on the normal desktop gcc compiler.

To compile it with the arm-linux-gcc I thought we had to make some modifications to the code. And I didn’t have a clue about the modifications that we had to make. They had not included a programming manual in the cd they gave us. So I tried compiling the same code with the arm-linux-gcc hoping that the compiler would suggest modifications. But unbelievably, the code compiled without errors! Here’s the code:

#include <stdio.h>
#include <pthread.h>

#define KP 15 / 10
#define KI 5 / 10
#define KD 10 / 10

float pid_control(float target, float current)
{
     float error;
     float delta_err;
     float p_out;
     float i_out;
     float d_out;
     float output;

     static signed int integral_err;
     static signed int prev_err;

     error = target-current;
     delta_err = prev_err-error;
     integral_err += error;

     if(integral_err >  200)
           integral_err  = 200;
     if(integral_err <  -200)
           integral_err  = -200;

     p_out = error * KP;
     i_out = integral_err * KI;
     d_out = delta_err * KD;
     output = p_out + i_out + d_out;

     if(output > 127)
           output = 127;
     if(output < -128)
           output = -128;

     prev_err = error;
     return (float)output + 128;
}

int main(void)
{
	float CO;
	float current,target;

	printf("Enter set point : ");
	scanf("%f",&target);

	printf("Enter initial controller output : ");
	scanf("%f",&current);

	while(1)
	{ 

		CO=pid_control(target,current);
		system("clear");
		printf("CO = %.2f",CO);
	        current=current+(CO-127)/10;
		printf("   Current = %.2f\n",current);
		sleep(1);
	}
}

And after transfering it to the board using a thumb drive, the program ran just as it had on the desktop. Wow! I had been wondering how I was going to learn the entire ARM architecture in a month, and on seeing this, I was flying with joy. This would save me a whole lot of work!

Still there is a long way to go. We have to design interface hardware, write device drivers for them, and get them all to work to gether. Lets see how it goes.

del.icio.us Digg DZone IndianPad Newsgator reddit Simpy SlashDot StumbleUpon Technorati

Embedded Linux Development Boards

, , , February 1st, 2008

This is the first of several articles that I’l over the next few months about developing Embedded Linux systems. Two of my friends and I have decided to make a Direct Digital Controller on an embedded linux SBC.

The first task for us was to acquire a development board. We approached Shreshta eTechnologies in Bangalore first. Though they had a board that would be perfect for us, they did not have the board in stock, and wanted atleast a month to get one for me. So we needed a different solution.

We searched again and landed up at SPJ Systems, Pune. After discussions we bought the SBC9302. Though we are having a few problems with it, the board rocks! Unbelievably powerful and has features enabling it to be used for a variety of highly complex applications.

Our application would be relatively simple. I’l post more later.

del.icio.us Digg DZone IndianPad Newsgator reddit Simpy SlashDot StumbleUpon Technorati

Video game controllers

, July 10th, 2007

I am supposed to take a seminar on some technical topic at the communication skills lab, the day after tomorrow. I thought I would just read something about video game controllers and give a small talk. (yea yea, i chose this topic only to make sure every one listens to me.. ;D)

But preparing for the topic turned out to be extremely interesting and exciting to me, because they have a lot more of instrumentation, than I had expected. Infact, they have more to do with instrumentation, than with any other field.

The potentiometers used in the joysticks, the accelerometers for motion sensing, and the piezoelectric vibrators for force feedback were all part of my curriculum, and this particular application excites me.

I must go and prepare for the presentation now. I want to share this excitement with my classmates too. Hope it goes well. ;)

Check this link: http://scienceline.org/2006/12/18/motioncontrollers/

del.icio.us Digg DZone IndianPad Newsgator reddit Simpy SlashDot StumbleUpon Technorati

A simulator for the PIC microcontroller

, July 10th, 2007

A few friends and I have decided to design a simulator for the PIC16F87xA series of microcontrollers as our final semester project. Most of the simulators and compilers available for the PIC microcontroller are commercial software. Microchip corporation’s Assembler is free, but not open source, and the C compiler that they offer is commercial.

There are quite a few open source counterparts, and gpsim is especially good among them, but still, all of them lack a good interface and are in no way friendly for the beginner.

That’s why we decided to go with this project, and if it turns out to be good, it will be released under the GNU public license. Initially we are planning to design the simulator using Visual C#, and then port it to Python at a later time.

If time permits, we will also try to include a few other PIC microcontrollers, and we even have plans for the ARM microcontroller. I guess we will be having some trouble with the C compiler part. Hope my CSE friends come to the rescue.

del.icio.us Digg DZone IndianPad Newsgator reddit Simpy SlashDot StumbleUpon Technorati