EZ-Tilt 1000 Serial error
Archiver
Posts: 46,084
Okay,
I have an EZ-Tilt100-045 from advanced orientation systems.
The tilt sensor works fine. Basically you send it a "1" and it serials
back to you the angle of the y axis and a "0" gives you the x axis.
I know the chip works fine because when I hook it up to hyperterm on a
PC I get the right numbers back.
Now I hook it up to my stampII. here's the code, pretty simple
data1 var byte
data2 var byte
serout 8, 16416,[noparse][[/noparse]"1"]
serin 7,16416,[noparse][[/noparse]data1,data2]
debug asc? data1
debug asc? data2
Now data1 is the right number, but data2 is something really weird.
For example I should get 80 for level and it goes up 81,82,83 etc as
the angle increses and 7F,7E,7D etc as the sensor turns in the other
direction.
That's what I get when I hook it up to Hyperterm.
But I get weird stuff like 8l,8¢,8Æ etc.
Clearly the second byte is getting screwed up in transmition.
But why? The first one comes across fine.
How can I correct this?
Thanks
Ed Lentz
elentz@e...
I have an EZ-Tilt100-045 from advanced orientation systems.
The tilt sensor works fine. Basically you send it a "1" and it serials
back to you the angle of the y axis and a "0" gives you the x axis.
I know the chip works fine because when I hook it up to hyperterm on a
PC I get the right numbers back.
Now I hook it up to my stampII. here's the code, pretty simple
data1 var byte
data2 var byte
serout 8, 16416,[noparse][[/noparse]"1"]
serin 7,16416,[noparse][[/noparse]data1,data2]
debug asc? data1
debug asc? data2
Now data1 is the right number, but data2 is something really weird.
For example I should get 80 for level and it goes up 81,82,83 etc as
the angle increses and 7F,7E,7D etc as the sensor turns in the other
direction.
That's what I get when I hook it up to Hyperterm.
But I get weird stuff like 8l,8¢,8Æ etc.
Clearly the second byte is getting screwed up in transmition.
But why? The first one comes across fine.
How can I correct this?
Thanks
Ed Lentz
elentz@e...
Comments
Have you tried replacing the 8mhz xtal with a 4mhz one? This
should bring the data rate down to 9600 baud, per the AOSI
data sheet. I have no experience with these sensors, but have
had similar problems interfacing the Stamp with fast serial
devices in the past. My guess is that the second byte is already
being sent before the Stamp has a chance to get ready for it. (At
least that has been my experience in similar projects). If you can't
find a workaround, perhaps swapping out crystals (8 to 4) would be
worth a try.
BTW, would you know how much one of these units cost? Verrrrry
interesting!
Steve
I have an EZ-Tilt100-045 from advanced orientation systems.
The tilt sensor works fine. Basically you send it a "1" and it serials
back to you the angle of the y axis and a "0" gives you the x axis.
I know the chip works fine because when I hook it up to hyperterm on a
PC I get the right numbers back.
Now I hook it up to my stampII. here's the code, pretty simple
data1 var byte
data2 var byte
serout 8, 16416,[noparse][[/noparse]"1"]
serin 7,16416,[noparse][[/noparse]data1,data2]
debug asc? data1
debug asc? data2
Now data1 is the right number, but data2 is something really weird.
For example I should get 80 for level and it goes up 81,82,83 etc as
the angle increses and 7F,7E,7D etc as the sensor turns in the other
direction.
That's what I get when I hook it up to Hyperterm.
But I get weird stuff like 8l,8¢,8Æ etc.
Clearly the second byte is getting screwed up in transmition.
But why? The first one comes across fine.
How can I correct this?
[/font]
I'll try to swap out crystals.
BTW the Ez-tilt 1000 only costs 100$
Ed lentz
elentz@e...
--- In basicstamps@y..., PicProgrammer@a... wrote:
> Ed,
>
> Have you tried replacing the 8mhz xtal with a 4mhz one? This
> should bring the data rate down to 9600 baud, per the AOSI
> data sheet. I have no experience with these sensors, but have
> had similar problems interfacing the Stamp with fast serial
> devices in the past. My guess is that the second byte is already
> being sent before the Stamp has a chance to get ready for it. (At
> least that has been my experience in similar projects). If you can't
> find a workaround, perhaps swapping out crystals (8 to 4) would be
> worth a try.
>
> BTW, would you know how much one of these units cost? Verrrrry
> interesting!
>
> Steve
Thanks
Ed Lentz
elentz@e...
--- In basicstamps@y..., rethin@y... wrote:
> I was thinking something along those lines too.
> I'll try to swap out crystals.
>
> BTW the Ez-tilt 1000 only costs 100$
>
> Ed lentz
> elentz@e...
>
> --- In basicstamps@y..., PicProgrammer@a... wrote:
> > Ed,
> >
> > Have you tried replacing the 8mhz xtal with a 4mhz one? This
> > should bring the data rate down to 9600 baud, per the AOSI
> > data sheet. I have no experience with these sensors, but have
> > had similar problems interfacing the Stamp with fast serial
> > devices in the past. My guess is that the second byte is already
> > being sent before the Stamp has a chance to get ready for it. (At
> > least that has been my experience in similar projects). If you
can't
> > find a workaround, perhaps swapping out crystals (8 to 4) would be
> > worth a try.
> >
> > BTW, would you know how much one of these units cost? Verrrrry
> > interesting!
> >
> > Steve
I don't know how much difference this might make, but I
believe using an array *might* help with the speed. It's
certainly worth a shot before you let the solder flow. [noparse]:)[/noparse]
Something along the lines of:
databytes var byte(2)
serout 8, 16416,[noparse][[/noparse]"1"]
serin 7,16416,[noparse][[/noparse]str databytes\2]
debug str databytes\1
debug str databytes\2
If all else fails, there are always hardware buffers. The Maxim
MAX3100/MAX3110 UARTs comes to mind. Al Williams has a
very good write-up, along with sample Stamp code, at:
http://www.al-williams.com/wd5gnr/suart.htm
Hope you get it working, Ed. Please let us know how you make
out.
Steve
I'll try to swap out crystals.
[/font]
A 10 minute trip to the electronics store, 5 minute soldering job and
presto, it worked perfectly.
Thanks
Ed Lentz
elentz@e...
--- In basicstamps@y..., PicProgrammer@a... wrote:
> Before you pick up that soldering iron.......
>
> I don't know how much difference this might make, but I
> believe using an array *might* help with the speed. It's
> certainly worth a shot before you let the solder flow. [noparse]:)[/noparse]
>
> Something along the lines of:
>
> databytes var byte(2)
>
> serout 8, 16416,[noparse][[/noparse]"1"]
> serin 7,16416,[noparse][[/noparse]str databytes\2]
>
> debug str databytes\1
> debug str databytes\2
>
> If all else fails, there are always hardware buffers. The Maxim
> MAX3100/MAX3110 UARTs comes to mind. Al Williams has a
> very good write-up, along with sample Stamp code, at:
>
> http://www.al-williams.com/wd5gnr/suart.htm
>
> Hope you get it working, Ed. Please let us know how you make
> out.
>
> Steve
>
>
> > I was thinking something along those lines too.
> >