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...
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...
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.
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...
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'.
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
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..
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!
Bookmarks