![]() | ![]() | ![]() |
| | |||||||
| Robotics Chat Specific to discussions about robots and the making of. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced Member | hi Alex, Copied it, I will give a spin, let you know.
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
| | |
| | (permalink) |
| Experienced Member | Well I'm absolutely clueless now, with LEDs on the outputs working as intended, and the PIC running the H-bridges fine when not using inputs from the sensors. I must be nearly there!! |
| | |
| | (permalink) | |
| Experienced Member | Quote:
Running in Sim OK. Observed Operation: RA2 and RA3 low NO flashing RB0 and RA0 are both Low ; RA2 high starts RB0 flashing. RA3 high starts RA0 flashing ; RA2 and RA3 high start RB0 and RA0 flashing. Observed flashing rates are the same for both pins, when operating separately or together. What are your sensor voltage levels.? going into the PIC pins.
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| | |
| | (permalink) |
| Experienced Member | Should be flashing very quickly though? Sensor voltage levels I am not sure, but it's enough to trigger an LED, so is obviously triggering the PIC program. |
| | |
| | (permalink) | |
| Experienced Member | Quote:
In real time, not the Sim, they will be flashing very quickly, you have no Wait states. The input threshold voltage is just over +2V for a +5V supply. Do you have a DVM.?
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| | |
| | (permalink) |
| Experienced Member | In the labs at uni, or at home. It triggers an LED on the outputs though, so it is obviously triggering it. Or is the output somehow (linearly?) related to the input voltage? |
| | |
| | (permalink) | |
| Experienced Member | Quote:
No, there is no relationship between the digital input and output voltages. When you say it triggers an LED, do you mean it lights an LED.? Can you post a diagram on how you have connected one LDR and one output pin, just a quick sketch would do, include all the components connected to the input and output pin. As you are driving an H Bridge, why are toggling the output pin at such a high rate.? rather than at a fixed voltage level. At a rough estimate, the Port output pin is toggling around 30KHz.!
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| | |
| | (permalink) |
| Experienced Member | Hmmm.... I think the problem may lie in my hbridge, as I have just been doing some testing with the PIC loaded up, and I've got some weird results. I'll probably cop out and buy a controller IC! Yes, it lights an LED. The reason I have my program setup this way is that is the easiest way I could think of implementing my design on my PIC! |
| | |
| | (permalink) | |
| Experienced Member | Quote:
Code: Main
;bcf porta,0 ;turns both
;bcf porta,1
;bcf portb,0 ;motors off
;bcf portb,1
btfsc porta,2 ;tests light on right LDR
goto rightlight ;if light,goto rightlight
bcf portb,0;;turn off if not called
btfsc porta,3 ;tests light on left LDR
goto leftlight ;if light,goto left light
bcf porta,0;turn off if not called
goto Main
rightlight
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| | |
| | (permalink) |
| Experienced Member | Brilliant!! It works-perfectly! Shows how much I need to learn. Thankyou!! |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Magic: The Mini-magic Switchboard should I make it a kit? | blueroomelectronics | Electronic Projects Design/Ideas/Reviews | 207 | 23rd June 2008 02:55 AM |
| End my elevator nightmares | fearlesss | Electronic Projects Design/Ideas/Reviews | 20 | 29th March 2008 02:39 AM |
| need help... | imisendo_4036 | Micro Controllers | 0 | 20th February 2008 01:14 AM |
| Changing the hex code | anthony123 | Electronic Projects Design/Ideas/Reviews | 22 | 16th February 2008 04:11 AM |
| Drive 33 Servos With One PIC + USART | wschroeder | Micro Controllers | 39 | 21st December 2007 08:01 AM |