Friday, 12 August 2016

LIST OF LINKS: REAL TIME CLOCK (RTC)

READ DATA FROM MICROCONTROLLER ( C# CODE )

using System;
using System.IO.Ports;
using System.Threading;

class PortDataReceived
{
    static SerialPort mySerialPort = new SerialPort("COM2");
    static bool _continue;
    static string indata;
    public static void Main()
    {
     
       
        Thread readThread = new Thread(Read);

        mySerialPort.BaudRate = 9600;
        mySerialPort.Parity = Parity.None;
        mySerialPort.StopBits = StopBits.One;
        mySerialPort.DataBits = 8;
        mySerialPort.Handshake = Handshake.None;
        mySerialPort.RtsEnable = true;
        mySerialPort.ReadTimeout = 500;
        _continue = true;
        mySerialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);

        SerialPort.GetPortNames();

        mySerialPort.Open();

        readThread.Start();
        Console.WriteLine("`");
        Console.ReadKey();
        mySerialPort.Close();
        Console.WriteLine("Press enter to to quit;");
        Console.ReadKey();



    }


    public static void Read()
    {
        while (_continue)
        {
            Thread.Sleep(2300);
            try
            {
                mySerialPort.WriteLine("`");
                //string message = mySerialPort.ReadLine();
                // Console.WriteLine(message);
            }
            catch (TimeoutException) { }
        }
    }


    public static void DataReceivedHandler(
                        object sender,
                        SerialDataReceivedEventArgs e)
    {
        SerialPort sp = (SerialPort)sender;
        indata = sp.ReadExisting();
        Console.Write(indata);

        string filePath = string.Format(@"D:\test\{0}.txt", Guid.NewGuid().ToString());
        /* ********Text file Generwting***********/
        using (System.IO.StreamWriter file =
           new System.IO.StreamWriter(filePath, true))
        {
            file.WriteLine(indata);
        }
    }
}

Friday, 13 May 2016

LOOPING AND JUMPING INSTRUCTIONS: DJNZ

Instruction: An instruction is an order or command given  to processor by a computer program,  set of instruction is known as program.

The DJNZ instruction decrements the byte indicated by the first operand and, if the resulting value is not zero, branches to the address specified in the second operand.

The INC instruction increments the specified operand by 1

The JZ instruction transfers control to the specified address if the value in the accumulator is 0. Otherwise, the next instruction is executed. Neither the accumulator nor any flags are modified by this instruction.



REFERENCE:



Tuesday, 3 May 2016

Registers

The CPU uses registers to store information temporarily,   The information could be two values to be processed or the address of the value needed to be fetched from the memory.

Registers inside CPU  can be 8-bit,16-bit,32-bit or event 64-bit registers.

Saturday, 30 April 2016

BUS ( COMPUTER )


  • CPU is connected to memory and I/O  through  strip of wire called a BUS.
  • BUS  is a set of signal lines.
  • BUS term introduced by Americans, earlier Britishers use to call this as HIGWAY.
  • BUS has conductors.


Three types off buses:

Address BUS
Data BUS
Control BUS


For a device ( memory or I/O ) to be recognized by the CPU, it must be a assgined address.
The address assigned to a given device must be unique, no two devices are allowed to have same address. The CPU put the address on the address bus.



SPECIFICATIONS OF BUS:


  • LOGICAL SPECIFICATIONS OF BUS:
  • ELECTRICAL SPECIFICATION OF BUS:
  • MECHANICAL SPECIFICATION:About pins etc ., ( 32,64 ... )



Data Transfer: Data
Priority Arbitration: Priority indicator, as par of the bus, it have dedicated signal lines for this.
Initialization: Power, system clock, monitoring power etc., ( It having another signal lies )















Why Binary Number System.



Computer use the binary number system because the two voltage levels can be represented as the two digits 0 and 1.

0= 0V
1= +5v