i don't know the default debug baudrate for those BS chip but can you select 2400 baud ?!?
i don't know the default debug baudrate for those BS chip but can you select 2400 baud ?!?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
hmm , well i got it set to 2400 , but inorder to do that, it discards all my formating comands and imback to ascii, i was thinking may the reason for junk out put, be that im sposed to count up 16 or 20 times, cause its 20 u seconds, that tells the servo what to do i think im taking partial readings,
for pulsout, theres a counter loop above the output, inorder to time it, i think my issues here is not reading in sections, im getting a flowing reading , and i need 20 u second intervals,
also id like to add, i saw the symbol for 149 rather freequently, is there a chart of ascii text, maybee, i need to refer to the amount in ascii txt for this to work , if i could map out the values we know will be here i can decipher ascii, now im thinking , at 2400 baud its working but i am inable to convet to # data i did see the symbol for 149 alot, but think i need to alsop put in timing or similar to make this work
Last edited by PICMAN; - 21st February 2005 at 18:08.
ok, ive decoded the VAR, at "zero" it does infact read 149 , and it does apear correct, if i use 2400 baud, on pic, it will get the readouts i expect, now mr e , can u tell me where to start lookin into to declare logical parameters using ascii,
for instance
___
if PLS = (o with 2 dots above it) then rled = 0 : lled = 0
___
also ive not found a table of ascii , from 1 - 200, i find 1- 12x, and then a seprate one for 12x - 200 , from my reading i find that the "extended ascii" tables are posibly not standard,
is there a peritcular one that i can depend on bieng standard for pic use,
how do i refrence ascii characters, this is compleatly new to me
well what to say to this one. If you receive your data with the PIC it will be already the great value, don't mix Terminal operation and PIC operation..
If by example your PC will get your value from the PIC, you can only send it like this
SEROUT PORTB.0,4,[Myvar1,Myvar2,Myvar3]
and leave it like this. Your PC software will get the right value of your var. Case you want to work with string, you'll have to get each character and do the ASCII to decimal conversion... not handy and so much time spending.
PIC to PIC. Send your data same as above and receive the same way.
Master: SEROUT PORTB.0,4,[Myvar1,Myvar2,Myvar3]
SLAVE : SERIN PORTA.0,4,[Myvar1,Myvar2,Myvar3]
OR maybe i didn't understand your question....
Sending text+Value of a var on a terminal:
SEROUT PORTB.0,4,["Myvar1 : ",#Myvar1," Myvar2 : ",#Myvar2,13,10]
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
indeed i was not clear, when i use purely ascii, i get prouduct i ecpect, for example 149 at zero,, but if i try to convert to DEC it gives me junk, i wish to use logic to say
if PLS = 143 - 153 then rled =0 : lled = 0
if pls > then 153 then lled = 1
if PLS < 143 then rled = 1
my problem, is the only way i can see to refrence the varible, is in ascii format, so i need to know how to type ascii text, in my pbp program,
finished prouduct will have NO serout and will be self running, no pc conected, i just conect bs2 to pc to see how i can interact with var PLS,, which i have found i get the numbers i expect with out hassle in ascii format,, so i believe if i can use ascii formatt in my program ,, i can logically creat a flow, like above, but with out dec format,, not 149 , o with 2 circles above, but i am unsure if i can use ascii in program , i know for bianary i use %0000 0000,, i call this refrencing bianary, how do i refrence ascii, and how do i type out ascii characters,
originally i planed to use code identical to above, but i find isues when i tell debug to read out dec format, so since i get numbers i know are what i need in ascii, i wish to refer to these values in ascii, to prevent garbage results, since ascii gets me what i need, and shows corasponding interaction when i controll sevo via remote , values change acordingly
in dec format they donot
or am i over thinking this, if i type code as above will it work, it seems to me the pic should know 149 = o with 2 circles above, (ascii )
Last edited by PICMAN; - 21st February 2005 at 21:15.
you can't refer to ascii to do your stuff.
if (PLS <153) AND (PLS> 143) then
rled =0
lled = 0
endif
if pls > then 153 then lled = 1
if PLS < 143 then rled = 1
this already work as you wish.
you can also refer to binary
if (PLS <%10011001) AND (PLS> %10001111) then
rled =0
lled = 0
endif
if pls > then %10011001 then lled = 1
if PLS < %10001111 then rled = 1
Or in hexadecimal
if (PLS <$99) AND (PLS> $8F) then
rled =0
lled = 0
endif
if pls > then $99 then lled = 1
if PLS < $8F then rled = 1
If you want to receive value from PC and convert it to decimal
SERIN2 PORTB.0,16780,[dec3 loop]
this will receive 3 character and convert it to decimal value from your terminal.
If you want to send 123 to pic type 123, if you want to send 10 type 010 and that's it
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
awsome so i was thinking to hard, if i read 149 at "zero" (in ascii text off bs2)
then i can refer to this value in pbp, as 149 and it will work,
this means my design works perectly,
ty
Bookmarks