The board has been populated and it is ready

February 8, 2010

PICdevelopment board

The board was populated successfully and most of the functional features of the board have turned out to be successful. I am yet to test one of the two voltage comparators available on the board.

The main features of the board include:

  1. PIC16F877A platform
  2. L293D module ( Can drive 2 geared DC motors or 1 stepper motor)
  3. ULN 2003A module for stepper motors
  4. Voltage comparator circuit for LDR based sensor module
  5. Voltage comparator circuit for IR LED – photodiode based sensor modules
  6. Analog Inputs
  7. Seven Segment Display * 4nos
  8. RS232 port
  9. LED outputs to test the comparators/voltage sensors
  10. 8 LEDs to test the outputs of the individual pins of the controller
  11. Plug and play option — Can test it with simple connecting wires across any pin of the microcontroller
  12. Power supply pins to power other add-on boards

Looking foward for your comments!


PIC serial communication

September 8, 2009

24 July 2009:

I am currently working on serial communication using PIC16F877A. More details to follow.

September 08 2009:

This shows how I procrastinate things. Finally, I achieved it. I have communicated to my PC using PIC16F877A. It took more than 48 hours to achieve this task!

Well! My two cents on serial communications is “Datasheet is your Bible!’

Never digress from the procedure mentioned in the datasheet!

In the rudimentary stages, I blindly followed the rules and I was able to send the letter ‘h’ to the hyper terminal. But I faced problems with the set baud rate of my microcontroller and it was sending some unknown characters to the terminal.

The frequency of my crystal oscillator was 11Mhz. Hence my Baud rate value would be 71 which was arrived at by using the formula given in the data sheet.

The screen shot of the letter h being received at the terminal is shown below!

First data from uC

I had to follow this procedure to declare an array containing the data ‘hello world’ which gives the satisfaction of winning a noble prize to any rookie.

The word ‘hello’ over the terminal ┬áis shown below:

Hell from uCThe Pic 16F877A data sheet can be downloaded from the Microchip website!

The code used for serial port communication was:

#include<pic.h>

void delay(unsigned int n)

{

while(n- -);

}

unsigned char data[17]=” hello world ‘”;

int i;

void main()

{

TRISC = 0x80;

SYNC =0;

SPEN = 1;

TXIE = 1;

TX9 = 0;

BRGH = 1;

GIE = 1;

PEIE = 1;

RCIE = 0;

SPBRG = 71;

while(1)

{

TXEN=1;

}

}

void interrupt isr(void)

{

for(i=0; i<=6; i++)

{

TXREG = data[i];

delay(500);

}

}

Happy Programming!
#include<pic.h>
void delay(unsigned int n)
{
while(n–);
}
unsigned char data[17]=” hello world””;
int i;
void main()
{
TRISC = 0x80;
SYNC =0;
SPEN = 1;
TXIE = 1;
TX9 = 0;
BRGH = 1;
GIE = 1;
PEIE = 1;
RCIE = 0;
SPBRG = 71;
while(1)
{
TXEN=1;
}
}
void interrupt isr(void)
{
for(i=0; i<=6; i++)
{
TXREG = data[i];
delay(500);
}
}