ok TRied the easy Prog Programmer,
http://www.embedinc.com/easyprog/index.htm
does not work more, same thing, I meam .. nothing is happening...
ok TRied the easy Prog Programmer,
http://www.embedinc.com/easyprog/index.htm
does not work more, same thing, I meam .. nothing is happening...
Last edited by lerameur; - 7th January 2007 at 05:48.
I also have te Pic18F4685, PBP do not have a file to compile this...
How do I go about making an Hex file out of it ??
Last edited by lerameur; - 7th January 2007 at 17:36.
ok I am doing a remote control for my robot I wrote a code below, It seems long, Maybe you have a better idea. I am using two Potentiometer , the values of each will control the left and right motor of the robot:
'Remote control*****************
direction var word : speed var word
Loop:
If (left => 115) AND (left <= 135) AND (right => 115) AND (right <= 135) then
goto stop
If (left => 115) AND (left <= 135) AND (right <= 115) then 'left is stop, right is CCW
goto LeftstopRightCCW
If (left => 115) AND (left <= 135) AND (right => 135) then 'left is stop , right is CW
goto LeftstopRightCW
If (right => 115) AND (right <= 135) AND (right <= 115) then 'right is stop, left is CCW
goto RightstopLeftCCW
If (right => 115) AND (right <= 135) AND (right => 135) then 'right is stop , left is CW
goto RightstopLeftCW
If (left > 135) AND (right > 135) then 'Left Cw & right CW
goto LeftCWRightCW
If (left > 135) AND (right < 135) then 'Left CW & right CCW
goto LeftCWRightCCW
If (left < 135) AND (right > 135) then 'Left CCW & right CW
goto LeftCCWRightCW
If (left < 135) AND (right < 135) then 'Left CCW & right CCW
goto LeftCCWRightCCW
In brief:
'Stop '--------------------------------$69 = 01 10 10 01
'Leftwheel =stop : Rightwheel= CCW '--- $A6 = 10 10 01 10
'Leftwheel =stop : Rightwheel= CW '----- $96 = 10 01 01 10
'Leftwheel =CCW : Rightwheel= stop '---- $9a = 10 01 10 10
'Leftwheel =CW : Rightwheel= stop '----- $A5 = 10 10 01 01
'Leftwheel =CW : Rightwheel= CW '---- $66 = 01 10 01 10
'Leftwheel =CW : Rightwheel= CCW '---- $56 = 01 01 01 10
'Leftwheel =CCW : Rightwheel= CW '---- $5a = 01 01 10 10
'Leftwheel =CCW : Rightwheel= CCW '---- $65 = 01 10 01 01
Last edited by lerameur; - 7th January 2007 at 22:29.
You're right. There probably is a better/shorter way to do that.
I'll think about it for a bit and get back to ya.
I take it that the reason you've got 115 and 135 is for a bit of a 'deadband' so the thing doesn't jitter on you?
(see that?, the manchester encoding is handy isn't it?)
How about
'Remote control*****************
direction var word : speed var word
bits var byte
'bits = bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
' LCW (-LCW) LCCW -(LCCW) RCW (-RCW) RCCW (-RCCW)
'use odd bits as a direction flag, use the even bits inverted from the others as the same thing, but also as a bit of error detection
TX end...
Loop:
bits = %01010101
If (left => 115) AND (left <= 135) then bits.7 = 0 : bits.6 = 1
if (right => 115) AND (right <= 135) then bits.3 = 0 : bits.2 = 1
if (right <= 115) then bits.1 = 1 : bits.0 = 0
If (right => 135) then bits.3 = 1 : bits.2 = 0
If (left <= 115) then bits.5 = 1 : bits.4 = 0
If (left => 135) then bits.7 = 1 : bits.6 = 0
transmit
goto loop
RX end....
In brief:
if bits.7 = bits.6 then bitserror 'bit pairs shouldn't be equal
if bits.5 = bits.4 then bitserror
if bits.3 = bits.2 then bitserror
if bits.1 = bits.0 then bitserror
'Stop '--------------------------------$69 = 01 10 10 01
'Leftwheel =stop : Rightwheel= CCW '--- $A6 = 10 10 01 10
'Leftwheel =stop : Rightwheel= CW '----- $96 = 10 01 01 10
'Leftwheel =CCW : Rightwheel= stop '---- $9a = 10 01 10 10
'Leftwheel =CW : Rightwheel= stop '----- $A5 = 10 10 01 01
'Leftwheel =CW : Rightwheel= CW '---- $66 = 01 10 01 10
'Leftwheel =CW : Rightwheel= CCW '---- $56 = 01 01 01 10
'Leftwheel =CCW : Rightwheel= CW '---- $5a = 01 01 10 10
'Leftwheel =CCW : Rightwheel= CCW '---- $65 = 01 10 01 01
And at the receiver end, the receiver code wouldn't actuate a motor until receiving a few correct codes in a row (a one time code wouldn't trip the motors into running).
Just a quick thought I had...
I got the module working now, I will be doing some testing thursday.
by the way i wouls like to have a crystal oscillate by itself, How do i do that ? I have a sensor chip that needs to be clocked. I tried connecting it to + and ground but nothing
Bookmarks