Tuesday, 27 September 2011

Keil Uvision 4 on Ubuntu

Hey all,
            i'm here to help you people out with installing keil in ubuntu.

Now you people might think.Can we really install programs with .exe extensions?
Well,here's an answer to you people "yes"?.

Wine is a powerful software(free software!) that aims to allow computer programs written solely for microsoft windows to run on linux environment.

if you want to know more about it.Here is a link on its articles:




Here are few simple steps to install wine :
  1. open terminal Applications>accessories>terminal
    2. Type the following command to install wine (you must be connected to
         internet):
                sudo apt-get install wine
    3. After installing wine to make it create duplicate "c:"drive configure it by 
        typing "winecfg" in terminal.


Install keil in wine by getting into the location where installation file is located in terminal by



                 "wine file_name.exe"
if file extension is other than exe type: " wine start file_name.abc"


hurray! installation is done.

next i'll be teaching how to use keil.

Thursday, 15 September 2011

Windows 8 developers preview!

I'm not sure of availability of win 8 in market.But i've got a video from youtube previewing win8.

This version will be first on tablets to compete with android (which is not obvious at all! and this is what i believe) later on for different machines.

If you have used win 7 in multitouch laptops,you would likely be disappointed because of its fewer functionality like pinch to zoom,two finger scrolling,twist to rotate etc., But win 8 is going to support certain new software layer that helps you  to pinch and rotate multiple objects at the same time, utilize more touch points, and manipulate the Start Screen interface as though your touchpad were a tiny touchscreen proxy, not a mouse substitute.


Happy! hurray! one more thing is software giants have made it clear that this will have backward compatibility with win7 applications!

Anyhow i'm not going to waste my money :-|

Wednesday, 14 September 2011

SPI interface programs for 8051 core microcontroller

HEADER FILE
#ifndef SPI_H
#define SPI_H

#include <8052.h>


#define SPI_SS         P2_7
#define SPI_READ    0x03
#define SPI_WRITE    0x02
#define SPI_WRDI    0x04
#define SPI_WREN    0x06
#define SPI_RDSR    0x05


/* SPI Special Function Registers */

__sfr __at(0XD5) SPCR;
__sfr __at(0XAA) SPSR;
__sfr __at(0X86) SPDAT;

void spi_init();
char spi_tx_rx(char val);
void spi_write_enable();
void spi_write(char val, char addr);
char spi_read(char addr);

#endif


LIBRARY FILE



#include <8052.h>
#include "spi.h"
#include "string.h"

#define SPI_SS P2_7

void spi_init()
{
    SPI_SS = 1;
    SPSR = 0;
    SPCR = 0x5c;
}

char spi_tx_rx(char val)
{
    SPDAT = val;        /* send data out spi port */
    while (!(SPSR & 0x80));    /* wait for transfer to complete */
    SPSR = 0;
    return SPDAT;
}

void spi_write_enable()
{
    SPI_SS = 0;
    spi_tx_rx(SPI_WREN);
    SPI_SS = 1;
    delay(10);
}

void spi_write(char val, char addr)
{
    spi_write_enable();
    SPI_SS = 0;
    spi_tx_rx(SPI_WRITE);
    spi_tx_rx(addr);
    spi_tx_rx(val);
    SPI_SS = 1;
    delay(10);
}

char spi_read(char addr)
{
    char ret;
    SPI_SS = 0;
    spi_tx_rx(SPI_READ);
    spi_tx_rx(addr);
    ret = spi_tx_rx(0);
    SPI_SS = 1;
    return ret;

}