Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Robotics Chat


Robotics Chat Specific to discussions about robots and the making of.

Reply
 
Thread Tools Display Modes
Old 7th March 2007, 08:50 PM   (permalink)
Default 68HC11 Based Robot Help

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
theinfamousbob is offline   Reply With Quote
Old 8th March 2007, 12:33 AM   (permalink)
Default

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..
bananasiong is offline   Reply With Quote
Old 8th March 2007, 12:47 AM   (permalink)
Default

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
theinfamousbob is offline   Reply With Quote
Old 8th March 2007, 01:18 AM   (permalink)
Default

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..
bananasiong is offline   Reply With Quote
Old 8th March 2007, 10:01 AM   (permalink)
Default

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
theinfamousbob is offline   Reply With Quote
Old 8th March 2007, 09:14 PM   (permalink)
Default

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
theinfamousbob is offline   Reply With Quote
Old 10th March 2007, 09:06 AM   (permalink)
Default

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
theinfamousbob is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
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



All times are GMT. The time now is 02:19 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.