Search found 15 matches

by Engineer41
Mon Mar 31, 2008 4:29 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello, I modified the code based on what you told me. This is my interrupt: case 1: PORTD = 0x01; // First Stage if(i<baCnt) { TMR0 = 0xFF; i++; count++; } if(i==baCnt) { TMR0 = servo0; //Set to the remaining count PORTD = 0x00; i=1; } break; case 2: break; } This is my main: baCnt = 2; while(1) { s...
by Engineer41
Sun Mar 30, 2008 10:47 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello, Thank you for the answer.....Could you please look at my code?? Code: if(INTCON.T0IF == 1 && INTCON.T0IE == 1) { count switch(count){ case 1: PORTD = 0x01; // First Stage if(i<bacnt) { TMR0 = 0xFF; i++; } else if(i==(baCnt)) { TMR0 = servo; //Set to the remaining count flag = 0; i=1; ...
by Engineer41
Sun Mar 30, 2008 8:24 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello! Thank you so much for answering! Just to make sure I understand correctly I would do this reset of timer the way that you did WHITHIN the switch statements??? so I would say case1: PORTD = 0x01; Set timer to FF; increment i; //set to FF amount of times needed set to final value that is needed...
by Engineer41
Sun Mar 30, 2008 7:59 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello!! My project is controlling six servo motors. They need to move in sequence. It is a robotic arm that my team and myself designed. It has one servo at the gripper, one at the arm, two at the shoulder, one at the elbow and at the base. This arm sorts objects based on their colors, and read and ...
by Engineer41
Sat Mar 29, 2008 3:35 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello, I have been working on it yesterday the whole day, and I am lost. I have 5 days to finish this :( . My PIC does not have large enough timer...I only have 0ne 16 bit timer and one 8 bit timer. The 16 bit timer I use for 20 ms , and the other one I can't make it work well for the servos delays....
by Engineer41
Tue Mar 25, 2008 9:39 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Its a 200 ns instruction cycle...
by Engineer41
Tue Mar 25, 2008 9:31 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello,


Does that mean all the calculations are to be made with doing the following?:

20MHz/2= 10Mhz = 10,000,000??

But my timers are only 8 bits and 16 bits...I'd have to use prescaler of 256 then:( don't I?
by Engineer41
Fri Mar 21, 2008 10:50 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello! Thank you for repliying! I can't define them together, I already figure it :D...but I need to change the timers I am using with PIC16F877A... I have a small question, is the instruction cycle the same? If my chip is 20Mhz frequency, do I perform the calculations in the same manner? Thank you!
by Engineer41
Thu Mar 20, 2008 2:11 am
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

I am not understanding something

Hello, I am defining the code in this way, your code ...I am pasting here a part: if(INTCON.TMR0IF) //check if TMR0 interrupt flag is set { //WriteTimer0( 0x3CAF ); TMR1L = 0x77; TMR1H = 0xFC; count = 0; INTCON.TMR0IF = 0; //clear TMR0 flag } if(PIR1.TMR1IF == 1 && PIE1.TMR1IE == 1) //if set...
by Engineer41
Thu Mar 20, 2008 2:10 am
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

I have a question...which might fix my problem...how do you I assign to a variable the first byte of a hex number in this form '0xf98E' ??? If I can do that I can fix the problem, cause I need to reassign the value of Timer1...


Thank you!
by Engineer41
Thu Mar 20, 2008 1:42 am
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

I am not understanding something

Hello, I am defining the code in this way, your code ...I am pasting here a part: if(INTCON.TMR0IF) //check if TMR0 interrupt flag is set { //WriteTimer0( 0x3CAF ); TMR1L = 0x77; TMR1H = 0xFC; count = 0; INTCON.TMR0IF = 0; //clear TMR0 flag } if(PIR1.TMR1IF == 1 && PIE1.TMR1IE == 1) //if set...
by Engineer41
Tue Mar 18, 2008 1:36 am
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello! THank you so much for answering again! I am using the idea of using interrupts and switch statements that you did in your code, I will certainly put your code as a reference! I am not using MPLAB and therefore I do not have functions such as writetimer1()....I can only give new values to regi...
by Engineer41
Mon Mar 17, 2008 8:02 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello! Thank you so much for answering! I am in such a mess right now with my final year project :( . I have a demonstration in two weeks and I am having trouble with my code .... Thank you so much for the explanation, I really appreciate it! I have one more question where I am totally lost, well tw...
by Engineer41
Mon Mar 17, 2008 2:22 pm
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

Hello everyone... I was wondering if someone could explain to me the initialization of servo1 and servo2, because I do not see how a delay is provided so that the servo moves in a certain position. I understand the interrupts and timers, how they are generated and preloaded, rescaled that is ok. I j...
by Engineer41
Mon Mar 17, 2008 6:01 am
Forum: Projects
Topic: The Wooden Menace; Robotic Arm
Replies: 66
Views: 79418

HELP

Hello everyone I need help in understanding a part of a code. int servo0 = 0xF63B; // Servo 0 int servo1 = 0xF077; // Servo 1 these two statements just initialize the variables with certain values, I do not see how this gives the delay to the servo motors with C???? Help! I need this for my final ye...

Go to advanced search