Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Why can't you use 255 in PWM? (http://www.chiefdelphi.com/forums/showthread.php?t=20835)

Andrew 27-05-2003 09:51

Why can't you use 255 in PWM?
 
I've heard that most people don't allow their PWMs to go to 255 and that it has something to do with the serout command. Nowhere in the serout documentation is there a reason given, so I assumed it had something to do with the RC.

Is it because IFI uses 0xff, 0xff as a marker for start of data sequence? If 2 PWMs next to each other in the serial stream were to max out at the same time, it would appear to the master uP as if the data stream had restarted and the remaining variables would be shifted.

If someone knows anything different, I'd appreciate a heads up.

Manoel 27-05-2003 10:54

Re: Why can't you use 255 in PWM?
 
Quote:

Originally posted by Andrew
Is it because IFI uses 0xff, 0xff as a marker for start of data sequence? If 2 PWMs next to each other in the serial stream were to max out at the same time, it would appear to the master uP as if the data stream had restarted and the remaining variables would be shifted.
That's exactly it. :D
Code:

Serout USERCPU, OUTBAUD,
[255,255,(PWM1),relayA,(PWM2),relayB,(PWM3),(PWM4), (...)]


Kevin A 27-05-2003 20:21

last year our programmer didnt know this...i went full in one direction and the robot stops, jerks, goes, stops jerks...

Lloyd Burns 28-05-2003 19:20

And it would have to be in the Serout from the Robot Controller that it went haywire, as the OI is programmed to max out any analog input at 254, unless there is no resistor on the input at all, which goes to 127.

The Serin statement uses the same synchronization method as the Serout, not that a programmer needs that information.

Ian W. 29-05-2003 14:50

yeah, it sure was fun, making the robot dance, until we realized that...

good rule of thumb, don't let anything get above 254, ever. well, as long as you're the programmer at least :p.


All times are GMT -5. The time now is 16:04.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi