Archive

Archive for the ‘Tech talks’ Category

Heard of Multiplexing?? what about Charlieplexing!

July 21, 2007 3 comments

Well as you know multiplexing is a method to communicate more data with a lesser existing channel or time. Just to sound similar because of a analogy char…plexin is called so.

 

Charlieplexing is method to drive more number of LED’s from very less number of pins. Now there are loads of pages talking about this method on the internet. I found most of the very vague. I have tried to assimilate them together here on my page. So here it goes,

 

It is a method of driving many number of Led’s with lesser number of drive pins. One simple analogy being, if you wanted to drive 6 Leds in some sequence how many microcontroller pins would you want?You would say 6. Why just you!! most would say 6.

 

These days we have 40 Pin microcontrollers which makes the value of each I/O pin really less. But first let me explain you the context. in small series of microcontrllers which would just have 5 pins, it is impossible to drive 6 Led’s with our concept of using a single pin for one LED.

 

Well i can hear you say that you can use a multiplexer!! a 3 to 7 Mux or something?? well i would say you are not wrong, charplieplexing provides an amazing method when in goes to huge numbers.

Concept:

Say we have 3 pins A,B,C of a microcontrollers. We can connect 6 LED’s in a combination such that,

 

When A=5v , B=0v we’l have LED1 glowing and all other LED’s off
When A=0v, B=5v we’l have LED2 glowing and all other LED’s off

 

Pair LED1 and LED2 are a complimentary pair. Similarly we can have 3 such pairs and control all 6 led’s form 3 pins.

 

I am very sure you are not clear about the concept.. Well you must read this to understand the concept completely. Link goes to instructables

Categories: Tech talks

Reverse engineering

July 19, 2007 1 comment

Internet provides so many cool ideas and projects with PIC microcontrollers and other Uc’s . Unlike in this blog , most examples will contain pre-compiles ASM or machine codes along with the example. All you will be able to do is just burn it into your Uc and use. The logic thoug explained will not be clear in the program.

What reverse engineering am i talking about?
If you didn’t know , All latest microcontrollers have their code written in ‘C’ Language. Softwares called compilers convert them into machine code and ASM.

Now i am looking for a product that can convert the ASM/machine codes given in those examples to understandable ‘C’ code. Thus making  understanding and upgradation easier.Hope to see one such product soon online!!

Categories: Tech talks

13.8 V Regulator

June 2, 2007 2 comments

There are standard available regulators. 12V,9V and 5V. Have you ever analyzed what you might need to generate a voltage regulation of say 12.7 V , 13.4 v ? or say 5.7V , 6.4 V ?Do you see some similarity? i think you do. They are increasing in steps of 0.7 .

Well the technique to do that is as given in the image below:

For the time being lets forget the capacitors .  The only other thing left in the circuit are the  7812 IC and the diodes . What you might wonder is a 7812 regulates the input voltage of 16-20 volts to 12 V . But the circuit here shows 13.8V . How to you account for that?

well is like this ,  The base or the middle pin drains through the two diodes dropping a voltage equivalent to their forward bias junction voltage. Since by applying standard voltage addition law you can add the voltages of the two forward biased diodes and the regulated voltage.

Slight math will give you : 12 + .7 + .7 = 13.4  . Here the diodes i assume give a forward junction voltage of 0.9V . Thus giving 1.8 V extra.

But the concept remains the same. The circuit shows IN4148 . Do check the forward bias junction voltage and tally the equation. But if you take a IN4007 Standard diode it will give you 13.4 in such a configuration.

You may regulate variable voltages in this method.

Categories: Tech talks

Testing Serial Port

Many times you might try to tinker with your serial port and get your external hardware interface with the serial port. In cases your serial port might not seem to respond. now the question arises if your hardware is at fault or your serial port?

The best way to test Serial Port:

Plug in a serial mouse and restart your computer. If the mouse works then you can make sure that you serial port is working perfectly. If otherwise you must check or replace your serial port.

Since most of us have shifted to USB keyboards its most common not to find one such mouse.In such cases you can try the following method.

Hyperterminal Serial Port Test:

Note the pin configuration of a male socket of a serial port.

PIN OUTS :


Steps:

1) Take a serial cable. Connect one end to the computer and have the other end free.

2) Short pins 2 and 3 of the side which are free . They are actually Tx and Rx pins. This setup is called NULL Modem configuration. Once the pins on the free end have been shorted you may proceed to the next step.

DB-9 :

DB 25:

3) Now you have essentially allowed a complete connection. the data that is transmitted through Tx is going to be as such received by Rx

4)Hyperterminal in windows can be used to send and receive datas.

Open Hyperterminal:

5) Open windows hyperterminal

6)

7)

8) Once a window opens after clicking ok. Type anything. here the phrase is “This is a Loopback test”

If you are able to type then your serial port is sending and receiving signals properly.
If you are not able to write then you’l have to check further (There might be a some problem with the port).

madan

Categories: Tech talks

You’l have to watch this micromouse.

January 8, 2007 1 comment

Where do you stand? A 1.39 minute video which you’l watch for 10 minutes!!!

Categories: Robotics, Tech talks

MP3 Player With PIC Microcontroller

November 10, 2006 4 comments

Well it has been one of my long wish to make a Mp3 player for myself using a PIC. I had seen projects online dealing with voice recording on PIC to one that i hit today which talks about Mp3 player using a PIC. Well i dont own one so possibly i am inclided to make one. I Think i’l feel more comfortable listening to the only song in my Home – Made MP3 player than listening to many on a branded one.

Well this guy on this page called Jesper Hansen <jesperh@telia.com>has just put up a whole site calle YAAP on his Homemade Mp3 Player . I am amused as his copyright statement on one of his earliest codes on the site dates “Copyright (C) 1989, 1991

I wonder Tehno guys just do it that fast. Alrite now i felt it was time for me to explore.
Soon i want to start working with this and come op with a beautiful INVOBOT Mp3 player!! Hmmm sounds too good already.

Well jesper has done all those with a AVR and DRAMs and since I Love PICs we’l have perfect cool PIC based MP3 player here.

Meanwhile i wanted to look into interfacing a DRAM and PIC. I found that too there and i thought i shall just pull it up here so that i don’t forget it later. I have not yet tinkered and explored those codes but its open for all. anyone try it and comment b4 me!!

Schematic

Code

I thing the code is pretty simple and you can get the explanation of this particular code and things on the site from where i hooked this up. The text is pretty small so make sure u feel comfortable reading it by pressing ctrl+”+” (i mean kepp control button pressed and press the “+” button to increase text size).

Cheers
Madan

Categories: PIC ideas, Project, Tech talks

Invobot launches New Web Directory

October 28, 2006 1 comment

Yeah i’ve been kind of busy these days with lots of work. I am sorry not to have come up with any electronics stuff for the past few days. Well while i’m exploring the USB interface and other stuff to make my own usb based PIC programmer , i just spent yesterday and today drawing up a website at http://discover.invobot.com .

This is just an effort to link up cool technical sites together using a automated system. Instead of me finding good pages and linking up on my site each and everday i thought it would be worth an effort to make an automated system to just do that. The interface has been kept simple and made as appealing as possible. I just put up a few adsense boards to cover up the page. Well making money through adsense? well not. i am expecting the directory to accumulate the best links availabale for technical guys like us. Once things add up well over there i am planning to give the desinging to a professional and get the links perfect. Next time you need not search in google for relevant technical links. just drive in to http://discover.invobot.com and find what you want.

Your Valuable contribtuion would be if you can help add up to the pages whenever you found a good page under appropriate category.

Thankyou.

cheers
Madan

shaatra Robotics : Problem Statement

July 3, 2006 1 comment

Shaasta is IIT-M Fest. It features a lot of comtestbut the one that drags into my interest in the RObotic contest. Well the contest runs through somewhere in the month of october. Registrations are done with your E-Mail Id’s .There are three robotic contests this time.

Get more information at http://www.shaastra.org/

Will put more details on contests and ideas to make bots soon. keep a watch on this space.

Exact Circuit and MicroC code for stepper motor

June 29, 2006 92 comments

Well saw that people still are having quite some doubts on the stepper motor post that i had put up. so i thot to make that abstact clear i better put the exact circuit and the code here.

The exact circuit to connect the stepper motor to 16F877A is given below

In this the common is connected to the 16V supply(12 v is actually enough actually higher current drives the motor better as far as i know*). If u are new here and donot know how to find the common line in a unipolar Stepper motor then see here

The MicroC code for running the motor is as below.
void main()
{
TRISB = 0×00;
PORTB = 0×00;

//routine to move in one direction
for (i=0;i<50;i++)// increse i=50 no i=100 to cover double the distance
{
PORTB=0×80;
delay(20ms);
PORTB=0×40;
delay(20ms);
PORTB=0×20;
delay(20ms);
PORTB=0×10;
delay(20ms);
}

//routine to move in the other direction

for (i=0;i<50;i++) // increse i=50 no i=100 to cover double the distance
{
PORTB=0×10;
delay(20ms);
PORTB=0×20;
delay(20ms);
PORTB=0×40;
delay(20ms);
PORTB=0×80;
delay(20ms);
}
}

There are much easier ways to write the above code but then i am not worried about the memory it’l take nor have any pressing need to keep my code small and trim ,so i guess this will make you absolutely clear of what i’m trying to do to make my motor run.

If you din know MicroC well,let me brief. The line PORTB = 0×80 (1000000)makes my 8th pin of the PORT “B” that’s b7 pin or the 40th pin go high.The next line PORTB = 0×40(01000000) will make the 39th pin go high and all other low.

Now whenever the pin at the input of the ULN2003 goes high say pin 1 the output pin 16 drains the current throuh the motor thus completing the circuit from supplt 16V through motor to the ground in that line. When you keep doing this in series as i called it the abcd pulse the motor will rotate . When your reverse the pulse order the motor rotates in the other direction. As simple as that. For most robotic application atleast at contest level you may use this circuit uinless you go for bigger stepper motors that need more current to drive and is greater than the 500mA that the ULN2003 can sink!!
i guess i was clear about using ULN2003 to drive a sstepper motor. pl post your comments and doubts
–Madan
I like keeping all my circuits small and simple and not crowd it with resistors and capacitors.Afterall its a hobby and we need not complicate it.Cheers.

PIC simulator : A cool one

June 29, 2006 12 comments

I guess most of you who are using using PIC for theirproject do use a simulator to test your code first then realise it as a hardware. For those who are not aware of simulators well i’l give it a briefing.
Simulators are software that you’l use to test your code.As in the case of PIC simulator you will load the .HEX file that you wrote in MicroC.

The simulator will give you the graphic view of the pins, an integrated LCD display on your screen and Program memory contents and the ROM memory contents of the PIC you will be using. All you have to do is it just load the.HEX you wrote and watch the poins go high and low. You may induce external sensor signal using a buttpn in front of the pins to actually suimulate how your program will respond on occurance of a signal from your sensor.There will be various spped of execution and you may view at your own pace.

Simulators greately help in optimising you code and are a great techinical tool.I normally use the simulator from Oshonsoft.

In that download page if you are using PIC16F877A you’l have to download the first one.
This software is not FREE and comes in a trial period of 30 trials. I made a partition of 2 GB to load a OS and load this using partition magic that essentially doesn’t damage your existing data during partition. Then at the end of trail period i reformat the 2GB and load this again and use.(Not a real fun still worth it).

The interface is cool and simple and nice to use with no complications and confusions.


In the picture above you may see lot of things . just don’t confuse. all you have to do is . File–>load hex. then just click to simulate.Then watch your pic screen tha’a the picture below.

i guess now things are clear. you can see the PINS and a green in front of it indicates a high in that particular pin and a grey color indicates a low. In pics that have A/D conversion facility you may adjust the A/D using a adjuster which is shown at the centre saying “Change Analog value”. Hey ant this will disappear once you set it so you’lthen have a cool uninterrupted view of your PIC and the PIN states. This will be most helpfull for someone beginig with a PIC learning.

For begginers i’l suggest you to just pull down an example hex provided to you after you installing Microc. for example the simplest being “LED Blinking” and test its hex on th simulator. This will give you a very good idea of using you simulator.
Well now chill out and get your copy od simulator and get working.

Madan
P.S:-This simulator is of great help and i had tested my micomouse code on this simulator and is amazing tool to debug.
–>to purchase a version i badly need 55 euro. is anyone likes to contribute a bit for that please feel free to donate here
Thanks for that!!!

Categories: Robotics, Softwares, Tech talks
Follow

Get every new post delivered to your Inbox.