TreadBot


Closed Thread
Results 1 to 40 of 177

Thread: TreadBot

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Maybe try a little bit of 'DEFINE CHAR_PACING'?
    It add x ms between serial characters on the output.
    Maybe at the higher settings it doesn't like having x characters in a short amount of time...who knows...

  2. #2
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    yeah, i have been keeping the reset pin high. i have also tried to reset it after every loop...and i can get it to slow down from 80 to 0 using the same program without a problem.

  3. #3
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    so i got the motors workign by changing the caps across the leads. i found out a couple days ago that the drawers i keep my caps in got messed up, so i ended up putting in 22pf caps instead of 1uf caps.

    so now i added on the parallax ping ultrasonic sensor, and its messing something up. heres the short code for the sensor:

    PulsOut ultra, 5
    PulsIn ultra, 1, ping

    "ultra is the port, and ping is the distance variable. the pulsin line seems to work, and the LED lights on the ping sensor, but everytime i send the pulsout command, it sends wierd characters to the LCD, and the "ping" variable doesnt change from 0.... the LCD is on portf.0 and the ping sensor is on portf.1.... the traces are fairly far apart, and there is nothing touching them.

    if i delete the pulsout line, everything displays where its supposed too, and the ping var = 0...

    i know i didnt describe it the best, but if anyone has any ideas, please let me know...

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dragons_fire View Post
    so now i added on the parallax ping ultrasonic sensor, and its messing something up. heres the short code for the sensor:

    PulsOut ultra, 5
    PulsIn ultra, 1, ping

    "ultra is the port, and ping is the distance variable. the pulsin line seems to work, and the LED lights on the ping sensor, but everytime i send the pulsout command, it sends wierd characters to the LCD, and the "ping" variable doesnt change from 0.... the LCD is on portf.0 and the ping sensor is on portf.1.... the traces are fairly far apart, and there is nothing touching them.

    if i delete the pulsout line, everything displays where its supposed too, and the ping var = 0...
    Those ultrasonic transducers generate some fairly high voltages while doing their work. I can easily see one of those dumping current across traces and causing your problems. Maybe try putting a series resistor inline with portf.0 and see what happens. Don't run the transducer, start low on the resistance, work your way up until the LCD doesn't work anymore, then back off one or two values. Then fire up the transducer and see what happens...
    Have you ever been 'bit' by one? I wouldn't touch the bare metal on it while it's doing it's 'transducing'.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Did you set the ultra pin to 0 before using Pulsout?

    Pulsout works by toggling the pin twice. To get positive pulses, the pin needs to be set low first. (if it wasn't already there)
    <br>
    DT

  6. #6
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    yes, i took it low before doing anything. heres a little more of the code:



    trigger con 5
    baudLCD CON 32 'baud rate for lcd
    lcd VAR PORTF.0 'lcd port
    ping VAR byte
    ultra VAR PORTF.1
    PORTF.1 = 0
    ping = 0


    SerOut2 lcd, baudlcd,[254,"G",1,1,"Ping Test"] 'display test on lcd in position 1,1

    start:
    Pause 1000

    PulsOut ultra, trigger 'send trigger to ping
    PulsIn ultra, 1, ping 'wait for ping variable

    Pause 1000
    SerOut2 lcd, baudlcd,[254,"G",2,2,#ping," "] 'display pin var in position 2,2

    GoTo start
    End



    so wheni take out the "pulsout ultra, trigger" line, everything works great (except the ping sensor cause it doesnt get its pulse). i added in long pauses so i could tell where the problem is. my LCD will display "ping test" in the correct position, then waits a second, displayes a wierd character, waits another second and then displays a couple wierd characters and then the ping variable. when it shows the wierd characters and ping variable, it just adds them right behind "ping test", not in the position its supposed to be in..

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Try this out and see what happens:

    trigger con 5:baudlcd con 32:lcd var portf.0: ping var byte:ultra var portf.1: portf.1=0: ping=0:SerOut2 lcd, baudlcd,[254,"G",1,1,"Ping Test"]

    start:
    Pause 1000
    PulsOut ultra, trigger
    PulsIn ultra,1,ping
    flags.0=0
    Pause 1000
    SerOut2 lcd, baudlcd,[254,"G",2,2,#ping," "]
    GoTo start
    End

    The flags.0 = 0 basically resets the LCD, might help, might not...never know...

    EDIT: And as mister_e noted below, flags.0 don't help here...DOH!!!
    Last edited by skimask; - 22nd May 2007 at 16:34. Reason: Doh!

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts