Monday, September 06, 2004

We're late

Got the motor circuit running with the PWM... works very well. Change to a more powerful motor - the P9000 from DickSmith that have a voltage range from 3V to 12V.


The next step is to get the photo interrupter working, build Itchy's body and also to get a IR transmiter and receiver to work. This past week has been a nitemare... 3 assignments, 1 lab test, thesis work and itchy, to work on!!! We are way behind time and we have to triple our workload from this week on...

Sleepless nite, here i come...

Monday, August 30, 2004

My circuit now...

This is how my circuit looks like as of 31/08/2004 (with motor circuit). MERDEKA!!!


Sunday, August 29, 2004

YES!!! WHY DIDN'T I THINK OF THAT!

While i was writing my previous post, i never knew i forgot to try the CASE STATEMENT! And i said i tried everything! NO NO!!! CASE STATEMENT WORKS!!! HAHAHA, i got a super PWM working for me... going up or down whenever i want it to! WOOHOO! Tomorrow got to go to Uni and collect the motor circuit! And one more thing... Liverpool SUCKS!!!

I give up...

I tried everything that i know of. Creating new functions, using for loops, if conditions! The best i can do is to make the PWM modulate upwards with the keyboard all the way up to 5V or modulate downwards all the way to 0V but not both with the same program! Going to ask my lecturer tomorrow.

Friday, August 27, 2004

Modulate pulse with with input from keyboard.

Figuring out how to modulate the pulse with via pressing keys from the board. For example: press "U" to modulate up and "D" to modulate down. Spent the whole day in the lab trying to figure it out! Anybody with ideas email tanchunsian@yahoo.com.

Thursday, August 26, 2004

Modulate My Pulse Width

The pulse width modulator is the next thing to play with. Pulse with modulators allow you to work with the length of the pulse width, changing the pulse width to suit the function.

In this case, the voltage regulator reduces the 9V battery to 5V. The multimeter connected across the PWM (CCP1 and CCP2) pin and ground should be 5V. My aim it to write a program so that 50% of the pulse width gets modulated... which gives us about 2.5V...

Create a new function out of main...

void init_PWM()
{
TMR2IE=0; //disable the timer2 interrupt. Don't need it. (I think)
PR2=124; //40KHz
CCP1CON=0x0c; //PWM mode
CCP2CON=0x0c; //PWM mode
CCPR1L=62; //50% duty cycle
CCPR2L=62; //50% duty cycle
TRISC &= 0xF9; //make pin 12 and 13 outputs by setting their TRISC bits lo
T2CON=4; //pre and postscale for timer 2 =1 and turn on timer 2
}



EUREKA!!!

Friday, August 20, 2004

BLINK BABY BLINK!!!

The next step is to get the PIC to talk to you. The way is to write a program that enables one of the pins to be set as the output, thus enabling you to connect and LED to it. If the circuit works and the connection is correct and the program it correct, the LED MUST blink!



I hear YOU!!!

Tuesday, August 10, 2004

Fix up the PIC (the brain of Itchy)

WE have to get the components to assemble the brains of Itchy.

The entire circuit would be mounted on 2 breadboards: consisting of..
1) Voltage regulator circuit (to lower the voltage of a 9V battery to 5V)
2) Reset circuit (To reset the state of the PIC)
3) MAX232 (an RS232 interface between the processor and the PC)
4) PIC