Saturday, December 22, 2007

SCILAB

It is a high level programming language in that most of its functionality is based around the ability to specify many computations with few lines of code.It is similar in functionality to MATLAB, but is available for download at no cost.GOTO SCILAB
Fig shows the scilab editor
Actually the software is faster than the matlab environment ,the personal experience proves scilab faster and consumng less space
while matlab consumes 3gb+,scilab takes only 30mb+


Fig below shows the scilab graphic window



Tuesday, November 6, 2007

The code for the 8085 simulator in C

Under construction
Assmbler+Simulator
available on request

Wednesday, October 31, 2007

80386 ,8086,80286 architecture & manual

For downloading 80386 reference manual along with datasheet click
here
there is a lot more to understand other than a manual
here is another site for the 80386 programming manual

Here is another link for the advanced microprocessors which make clear the architecture and programming things more.The site deals with all the x86 series processors.

Thursday, October 18, 2007

8085 REAL TIME SIMULATOR

I have developed an 8085 simulator with real time computation , using the great C language .Some of the improvements of the simulator is that it enhances the stored program on the hard disk to be
loaded into the virtual 8085 environment and it also helps us to save the data(8 bit) as well as the code (8bit) for later use .Many of the present day simulators doesn't have these capabilities of save and load concept!


Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as its compiler. It creates native Win32 executables, either console or GUI.
Dev-C++ is Free Software (also referred as Open Source), and is written in Delphi.To download the software either click on the image above or gotodevcpp
The simulator can be downloaded from the side bar.
pls comment abt the good and bad things abt the simulator so that i can improve that

Saturday, August 4, 2007

Undocumented 8085 Instructions

FLAG REGISTER of 8085
Bit undocumented 8085 Remark
7 (MSB) S Mark flag,sign flag
6 Z Zero flag
5 X5,k Originally unused, concerning X5 or k it mentions later
4 AC Auxiliary(Assistant) carry or half carry and for BCD operation revision
3 0 Unused
2 P Parity flag, as for just Z80 CPU overflow flag combined use
1 V Overflow flag or subtraction flag
0 (LSB) C Carry

X5-in case of the usual 8 bit addition and subtraction when the mark of 1st operand S1, the mark of 2nd operand designating the mark of S2 and the operational result as R, it seems that can describe the change of X5 with the formula, X5 = S1 & S2 | S1 & R | S2 & R.
UNDOCUMENTED INSTRUCTIONS OF 8085
Operator cord/code clock
undocumented 8085 Discription

08 10
DSUB HL = HL - BC . Z, S, P, CY, AC and X5, V all flag receives influence
10 7
ARHL,RRHL Rotate HL right. 16-bit rotation, flags unchanged.HL = HL/2 and CY = L0 .
ARHL order is arithmetic right shift of HL register pair. MSB of the H register which means the mark does not change. The least significant bit of L register enters into the CY flag. Just the CY flag changes.
18 10
RDEL,RLDE Rotate DE left. Bit 15 to Carry. No other flags.
DE = DE*2 and E0=CY and CY =D7
20 RIM RIM read interrupt mask
28 10
LDHI imm,ADI HL,bb Add 00bb immediate to HL, setting flags.
DE = HL + imm
30 SIM SIM set interrupt mask.
38 10 LDSI imm,ADI SP,bb Add 00bb immediate to stack pointer, setting flags.
DE < - SP + imm
CB 6/12 RSTV,OVRST8 RST 8 (to 0040) if the V flag is set.
push PC and PC = 0040H
D9 10
SHLX,SHLDE LD [DE],HL.[DE] = HL
DD 7/10
JNX5 addr,JNK addr Jump to location addr if K flag is reset.
if (! X5) PC = addr
ED 10
LHLX,LHLDE LD HL,(DE).HL=[DE]
FD 7/10
JX5 addr,JK addr Jump to location addr if K flag is set.
if (X5) PC = addr

The 8085 is 100% software compatible with the 8080. It was called the 8085 because it's a 5V version of the 8080, which needs +5, +12 and -5 voltage supplies.

Tuesday, July 3, 2007

programming in C

Here is a program written in c for the digital clock
program:
void main()
{
int a,b,c;
c=b=0;
a=1;
TRISC = 0;
TRISA = 0;
TRISB = 128;


while(1)
{
if((b & 128)==128 )
{
while(1)
{
TRISA = 31;
TRISB = 255;
TRISC = 255;
a=PORTA;
b=PORTB;
c=PORTC;
if ((b & 128)==128)
continue;
else
{
break;
}
}
}

PORTA = a;
PORTB = b;
PORTC = c;



c++;
if((c & 10) == 10 )
{
c=c+6;
}
if(c==96)
{
c=0;
b++;
if(b & 10 == 10)
{
b=b+6;
}
if((b==96)||(b==224))
{
b=0;
a++;
if(a & 10 == 10)
{
a=a+6;
}
if (a == 19)
{
a=1;
if(b & 128 ==128)
b=0;
else
b=128;
c=0;
}
}
}
Delay_ms(1000);
}
}
use microc compiler if necessary

Friday, June 15, 2007

A digital clock using PIC16F72

'****************************************************************
'* Name : clock.BAS * '* *
'* Author : [RAVEENDRA PAI G] *
'* Notice : Copyright (c) 2007 [RAVEENDRA PAI G] *
'* : All Rights Reserved *
'* Version : 1.0 *
'* Notes :digital clock *
: The program counts if the portb.7=0 and loads the count if the portb.7=1 following are the functions of the ports
portA=hour indicator in bcd
portc=second indicator in bcd last pin ie pin7 is not used for indicating time its for am or pm
portb=min indicator with last pin i/p
NOTE that the statements starting with ' are comments!
'****************************************************************
b0 var byte 'b0 as byte
b1 var byte
b2 var byte
b3 var byte

b0=b1=0 'initialization
b2=1
l6: 'redefinition label
TRISA=0
TRISB=128 'making the pins i/p as well as o/p
TRISC=0

l1: 'label1

poke PORTA,b2 'writing variable b2 to portA
POKE PORTB,b1
POKE PORTC,b0
pause 1000 'pause for 1 sec

peek PORTB,b3 'peeking the portB for some interrupts on the i/p pin 7
if ((b3 AND 128)=128) then goto l5 'checking the pin condition

b0=b0+1 'updating the sec variable
if (b0 AND 10)=10 then b0=b0+6 'if b0 value is (lsb)10 then its is updated to bcd
if (b0=96) then goto l2 'for 60 it is updated to 0 and min =min+1
l9:
goto l1
l2:
b0=0
b1=b1+1
if ((b1 AND 10)=10) then b1=b1+6 'same function as b0 updation but min
if ((b1=96) or (b1=224)) then goto l3 'msb is the am or pm indicator
l8:
goto l9

l3:

b1=0
b2=b2+1 'hour update
if ((b2 AND 10)=10) then b2=b2+6
if (b2=19) then goto l4 'hour returns to 0 and am<=>pm
l10:
goto l8
l4:
if ((b0 AND 128)=0) then b0=0
if ((b0 AND 128)=128) then b0=128
b1=0
b2=1
goto l10
l5: 'interrupt loop for time reset
TRISA=31 'redefining the pins all as i/p pins
TRISB=255
TRISC=255
peek PORTC,b0 'peeking pins and writing them on variables
PEEK PORTB,b1
PEEK PORTA,b2
if ((b1 AND 128)=128) then goto l6 'check for interrupt cancel portb.7=0
goto l5
#########################################################
for the bcd to sevensegment conversion use a 74LS48 :
PIC16F72


connect the memoryclr complement to vcc through a resistor(4.7k)
connect the vdd to vcc
connect the vss to gnd
connect the 10 and 9 to a common point through a capacitor of value 22pf (10 to 33pf)and connect that point to vcc through a .1microfar capacitor
Use switch to load the time and count !

Tuesday, May 22, 2007

Coupling & transmission

Well there is a great difference between these two words but may feel same
practically! Once my friend Manu thomas was completing his excel project
,perhaps violated some ckt connections .Anyway a "man" call for me had
been made .At that time we were completing our project on robotics .
Stunned looking at the result!
The project included a laser based voice transmitter and receiver .
When he had removed the laser somewhat due to some power
supply problems related to the laser ,becoz he used the laser torch
which is available in market for just 30.00RS at marine drive ,
and instead of battery ,he used the 3v from the transmitter ,
connected only for the demonstration .Anyway demonstration
completed successfully.The transmission quality was great with
the help of laser .When the wire connecting the laser to the transmitter
broken it was found that there was a slight change in quality of the sound
transmitted,instead of vanishing of received signal.(he used mobile phone
music as sound source).
Astonished!proving nothing in theories!sound had been transmitted
without modulation without antenna which requires large height!
Is it possible?
what happened next

Thursday, May 17, 2007

what makes a human different from a robot?

what makes a human different from a robot?
The answer is simple his cpu the gr8 "brain",with stable processor
,world had ever seen .why human beings are different from other
things in this world ?what makes u feel so?my opinion is that he
is not different from the real world ! he is a part of it just as an
electronic robot he has sensors ,cpu ,and a learning programme
which makes him different from the other things in the world .
Besides there will be some database exsisting.
For a comparison please visit toggle.
Any body intereseted please comment..

Wednesday, May 2, 2007

Three laws of robotics

In science fiction, the Three Laws of Robotics are a set of three rules written by Isaac Asimov, which almost all positronic robots appearing in his fiction must obey. Introduced in his 1942 short story "Runaround", although foreshadowed in a few earlier stories, the Laws state the following:

1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
2. A robot must obey orders given it by human beings except where such orders would conflict with the First Law.
3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.

Later, Asimov added the Zeroth Law: "A robot may not harm humanity, or, by inaction, allow humanity to come to harm"; the rest of the laws are modified sequentially to acknowledge this.These laws are becoming essential for the design of intelligent robots.

Saturday, April 21, 2007

PC based high frequency LED display



Its the project,we did for our Excel 2K7 and won the 1ST prize .
It consists of row decoder and column decoder with an 8-bit counter .
remember that all decoders are active low and for the current sinking process
one of the decoders must be inverted to give it to the led display array,ie (32X8)
The serial data is given to the 3to8-bit decoder enable input ,to blink
the corresponding led to blink.A computer programme to send the high bits of the
character map to the parallel port & the process is done so fastly which produces
illusion of character on the display board.
its all about the working of the led display
ADVANTAGES
-The main advantage is ,less power consumption .
-secondly only one out put from parallel port .
-by changing the programme we can display any thing .
-can display any font .
the programming part is done by Mr: Arun Prabhakar (http://digitalpbk.blogspot.com/)

Monday, April 16, 2007

Simple Counting Program

b1 var byte           'declares the variable b1 as type byte
poke TRISB, 0          'defines the all pins on the portB as output pins
let b1=0
loop:          'its an identifier for iteration
pause 1000          'it pauses the programm execution for 1 second
poke portB,b1          'writes the value of b1 on portB(decimal<=>binary)
b1=b1+1          'updetes the variable value to the nxt value
goto loop          'substitution for the loop statement,a simple goto
The connection diagram is as shown



Saturday, April 14, 2007

The programmer and the burner

The programmer details are available here
The programmer is a multi pic pragrammer .
we tried it and are happy to use that because the actual pic pragrammer costs
about 2000 Rs.But this programmer costs only less than 200Rs.
The ic burner software we have used is the
icprog

Friday, April 13, 2007

The compiler

The compiler for the pic basic pro or picbasic is free with some limitations
Its free version is available Microcode studio
The microcode studio contains the compiler and its free version is enough for ur use.

Constants

Named constants may be created in a similar manner to variables. It can be more convenient to use a constant name instead of a constant number. If the number needs to be changed, it may be changed in only one place in the program; where the constant is defined. Variable data cannot be stored in a constant.

Example

mice CON 3

Variables

Variables are where temporary data is stored in a PicBasic Pro program. They are created using the VAR keyword. Variables may be bits, bytes or words. Space for each variable is automatically allocated in the microcontrollers RAM by PBP. The format for creating a variable is as follows:

Label VAR Size{.Modifiers}

Label is any identifier, excluding keywords, as described above. Size is BIT, BYTE or WORD. Optional Modifiers add additional control over how the variable is created. Some examples of creating variable are:

dog VAR byte
cat VAR bit
w0 VAR word

Thursday, April 12, 2007

Branch command

Syntax:
Branch offset, (label0,label1...)
Uses offset(byte variable)to index the list of labels.
execution continues at the indexed label according to
the offset value.
Example:
Branch B8, (label0,label1,label3)

if B8=0,then the program execution jumps to label0
if B8=1,then the program execution jumps to label1
and if B8=2,then the program execution jumps to label2

Goto statement:

Syntax:
Goto label
program execution jumps to statements begining at label.
Example:
Goto loop 'program execution jumps to the statements following the label loop
.
.
.
loop:
. 'statements
.
.

Let

Let assigns a value to a variable.
The value assigned may be
1.A constant(Let B1=0)
2.The value of another variable(Let B2=B1)
3.The result of any math operations
(The operations are performed strictly
left to right and all operations are performed
with 16-bit precision
Syntax
Let var=value

Pause command

This command provides a pause in program execution for
the period in milliseconds.Period is a 16 bit number
that can hold a maximum value of 65,535.
In milliseconds,that works out to just over one minute.
(60,000ms).Unlike the other delay functions ,Nap and Sleep,
the pause command doesn't put the microcontroller into a
low power mode.This has both an advantage and a disadvantage.
The disadvantage is that pause consumes more power :
The advantage is that the clock is more accurate
pause 250 'Delay for .25 seconds
Applications:
The pause finds application in some situations where some
signals at the output or input pins may remain unchanged.
For example A typical gearbox motor will respond only after
30ms,after the appliction of valtage to it.

Wednesday, April 11, 2007

If .. Then statement


If coparisonstatement Then Label
This is similar to the if statement in C language
The Then in if..Then is essentially a Goto.Another
statement cannot be placed after the Then .What
follows must be a label.The command copares variables
to constants or to other variables.If only one variable
is used in comparison then it must be placed on left.
All coparisons are unsigned.

The peek command

We can use the peek command to check the status
of any input line.Using the peek command we can
read the five i/o lines of portA or the eight i/o
lines of portB at once.
syntax
peek address, var
As its name implies,the peek command allows to
view or peek at the contents of the specified
memory address.Typically the memory address
peeked at is one of the pic microcontroller's
registers.The peeked value is stored in a
variable var defined in the command.
The peek command can read an entire byte at
once as in thecase of portB ,but in the case of
portA only lower 5 bits of the peeked value are
relevant.
Bit0..Bit15
The first 2 bytes of ram memory,B0 and B1 are
special.This is because we can test the bit
values contained in each byte.
For B0,Bit0 to Bit7
B1,Bit8 to Bit15
Using these we can check the condition
of the input bits or pins at the port.

Tuesday, April 10, 2007

Some things to be noted while writing picbasic programs

Identifiers
Identifiers are names used for line labels and symbols.
An identifier may be any sequence of letters ,digits,and
underscores,but it must not start with a digit.
Identifiers may be any number of characters in length :
however,the compiler will recognize only first 32
characters .Identifiers are not case sensitive hence
the labels LOOP:loop:Loop,etc will be read equivalently.
Line labels:
Labels are anchor points in our program.They are identifiers
followed by a colon.
Symbols
Symbols make our program more readable.They use identifiers
to represent the constants,variables or other quantities.
Symbols cannot be used for line labels
Example:
symbol five = 5 'symbolic constant
symbol number = W2 'named word variable

Monday, April 9, 2007

High & Low commands in pic basic

We can output any bit at the ports randomly by using the High & Low
commands.These commands are limited to the portB .So the poke command
is necessary to output the bits at the portA.
Example :
High 0 'makes the output 1 at 0th pin of portB
Low command
Low command makes the output at the specified pin low .
Example:
Low 1 'makes the output 0at 1st pin of portB

PIC 16f84A RAM

Ram may be accessed as bytes (8bit numbers ) or words(16bit numbers).
pic basic has predefined a number of variables for us .Byte sized
variables are named B0,B1...B51 & the word sized ram BY W0,W1..W25.
The byte and the word variables use the same memory space and
overlap one another.

comments

Comments are includeed by inserting a ' symbol(single quotation mark)
Comments are stripped in the hex file hence we can write any number
of comments in our program.

Sunday, April 8, 2007

The poke command

Once the lines have been configured (input or output )using
TRIS register ,we can start using port.To output a binary
number at the port,simply write the number using the poke
command.The binary equivalent of the decimal number will
be written to the port.
For example :
Poke 6, 0
will write 00000000 to the portB
poke 6, 255
will write 11111111 to the portB
Where 6 is the address of the portB
In a similar fasion we can output any decimal number between
0 and 256 (excluding 256) to the portB.

BASIC Language for PIC 16f84A programming

We can use basic or C language for the pic programming ,as
it is easy and simple to understand.The programs written in
assembly language for pic are complex and are not easy to
understand .Its future reference is difficult even thoughits
efficiency is high.
We did the pic programming,using the pic basic.


  • Some things to be noted while writing picbasic pr...


  • High & Low commands in pic basic


  • PIC 16f84A RAM


  • comments


  • The poke command




  • PIC 16F84A registers & ports
  • Friday, April 6, 2007

    PIC 16F84A registers & ports

    The pic 16f84Acontains 2 i/o ports ,port A& port B.
    Each port has two registres associated with it ,the
    TRIS(tri state )register and the address itself.
    The TRIS register controlls whether a particular
    pin on a port is configured as an input line or an
    output line .once the ports are configured the user
    may then read or write information to the port using
    the port register address.In 16f84A there are 8 pins
    available for port B & 5 for port A.
    --------------------------------------------
    REGISTER MEMORY MEMORY
    LOCATION(hex) LOCATION(decimal)
    --------**---------------**-----------------
    PORT A -----05h------------- 5
    PORT B -----06h -------------6
    TRISA -------85h -----------133
    TRISB -------86h------------ 134
    ---------------------------------------------

    Thursday, April 5, 2007

    PIC 16F84A microcontroller architecture

    Pic micro controllers use haward architecture ,which
    uses seperate data and program memory .Also it uses seperate
    buses to communicate with each memory type .The haward
    architecture has an improved bandwidth over the von neumann
    architecture which uses same bus for the data and instruction.
    The data memmory can be further broken down into general
    purpose ragisters and special purpose registers.
    The registers in the Pic 16f84A are mapped at specific addresses
    in the data memory section.The picbasic language allows us to
    read & write to these registers as if they are std: mem:bytes.
    we read and write to these registers using the peek and poke
    commands in the pic basic language .
    we had used the Pic basic pro for the compilation & succeeded.
    Anyway the basic language made the programming task simple!

    PIC 16F84A microcontroller


    PIC 16F84A microcontroller(MC)
    --------------------------------------
    General features :
    Risc cpu 35 single instructions
    operating speed DC-10MHz clockinput
    1k program Memory
    14 bit wide instructions ,
    8bit wide data path,
    direct &indirect &relative addressing:
    1000erase/write cycles:

    Peripheral features :
    13 i/o pins with individual direction control :
    high current sink/source for direct LED drive (25 mA sink max.per pin
    20mA source max .per pin ):
    TMRO-8-bit timer /counter with 8-bit programmable prescaler

    ------------------------------------------------
    BASICS:
    The 16f84A MC is a verstile MC with Flash memory (1K x 14bit )
    on board can endure a minimum of 1000 erase/write cycles .
    The program retension time B/w erase/write cycles is approximately
    40 years .
    The 18 pin chip devotes 13-pins to i/o .the pin status
    (I/O direction controll )can be done through programming .

    Can be programmed using assembly language or high level language .
    In the case of high level language such as BASIC we need a copiler
    to convert the programme to the hex file which can be directly
    programmed in to the PIC using a PIC programmer which is commonly
    available in the market.But the programmer will be costly for us
    (it costs nearly 3000Rs).So the best thing is to make one programmer
    as per the ckt diagram given in the site .we tried it & succeeded in
    it to programme the 16f84A.It is also used to program other pics.
    In the case of assembly language programming we need one assembler
    to conver it to the Hex file.
    We tried first with the BASic language and found it is the best to
    programme than the assembly language ,being less prone to error &
    easy to understand .We used the pic basic pro for compilation.

    Tuesday, March 6, 2007

    Microcontrollers


    microcontroller based photo rover

    A microcontroller is an inexpensive single chip computer .
    single chip means that the entire computer system lies within
    the confines of the integrated circuit chip .
    Primarily a microcontroller is capable of storing and running a
    program(its most important feature).The microcontroller contains
    a cpu ,ram ,rom ,I/O ports(pins in general),timers,and sometimes
    other built-in peripherals such as A/D(analog=>digital) &D/A
    converters.

    Monday, March 5, 2007

    The golden trophy


    Here it is! proving again and again that we are the best of
    model engineering college.The best stall award in the project
    exhibition contest for theacadamic year 2007 goes to E4A
    (electronics A batch) & here's our rolling trophy.
    -------------------------------------------------------------




    The members of our project group are
    --------------
    Arun Prabhakar
    Raveendra Pai.G
    Jaison Varghese
    Rahul Rajan
    Hari P.R
    Jyothish Nelson
    --------------
    A special thanks for Manu Thomas even he is not a member of the
    project group,considering his helps during the days of excel.