![]() |
![]() |
![]() |
|
|
|||||||
| Robotics Chat Specific to discussions about robots and the making of. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I've built a small tank-tread robot with a 68HC11E2 chip, and am having some problems reading sensors. My motor outputs work fine, but the 'bot will only read one sensor, on the LSB line. I know both sensors work, because I can switch and it reads the other sensor on the LSB. When the 68HC11 boots in single-chip mode (like it's set to do right now), Port C (which I'm trying to use) defaults to all inputs. I'm just not sure why I can't read anything other than the LSB. My code is reading the entire byte, not just a bit. I'm using sbasic to write the code, which right now is set to trigger the left motor for the left sensor and the right motor for the right sensor. Any ideas/experiences?
-Infamous
__________________
-Ian |
|
|
|
|
|
|
(permalink) |
|
I used 68HC11E9 to do my project last time, but in assembly language. Port C can be either input or output, you have to configure that port. How do you write the code for getting input from port C? Is the input pin floating?
__________________
Superman returns..
|
|
|
|
|
|
|
(permalink) |
|
The other (unused) inputs might be floating, I'll try modifying the DDRC to only accept on two bits...
The sensors have pull downs on them, so I know that's not the problem. I don't think the pins are really floating either, because the LSB always works, and the code isn't using binary; it's using plain 'ol integers.
__________________
-Ian |
|
|
|
|
|
|
(permalink) |
|
how do you check the input?
for example, load port c to accumulator a, then it is ANDed with $01 (which is 00000001 in binary, so checking the LSB), then BEQ (Branch back if EQual to zero), otherwise, continue the following code. Is it like that you check the input?
__________________
Superman returns..
|
|
|
|
|
|
|
(permalink) |
|
I'm writing in SBASIC (Google it, first hit is the download). It uses peek and poke, just like any other basic variant. I'm peeking at $1003 and pulling a byte from the port. I know there's a 16-bit peek as well; I'll try that today and see if it helps.
(There's just not enough time to learn assembly before the competition...
__________________
-Ian |
|
|
|
|
|
|
(permalink) |
|
Update...
Got it fixed. Didn't realize the sensors I built were active off...found that out pretty quickly (not...). I built the sensor boards without looking at the fact that it had a pull-up and not a pull-down. Thanks for the help though!
__________________
-Ian |
|
|
|
|
|
|
(permalink) |
|
The robot's finished...I've been up about 23 1/2 hours straight. School, then robot building, then work 'til midnight, then building until now. It works though. It's designed to move through a "journey course," with a hill in the middle. The link's here:
www.nationalroboticschallenge.org Here's the Journey course: http://www.nationalroboticschallenge..._Robot_Course_ I have to be there inside of 5 hours...oh joy!
__________________
-Ian |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Wireless robot (with a camera) | bloody-orc | Robotics Chat | 30 | 2nd September 2008 11:03 PM |
| Robot wars!University of Cape town Mechatronics project | riki4eva | Electronic Projects Design/Ideas/Reviews | 7 | 28th June 2008 05:52 AM |
| Motor Sizing For Moving Robots | dknguyen | Electronic Theory | 6 | 25th April 2007 10:43 PM |
| ''robot based on microcontroller'' | mohammed elzaq | Robotics Chat | 3 | 30th July 2005 05:13 PM |
| computer based robot | bloody-orc | Robotics Chat | 1 | 22nd December 2004 06:12 PM |