Go to Post And you wonder why these guys are figuring out where to hang another Chairman's banner. :) - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2002, 20:35
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Why a PWM value should NEVER be 255...

This is also why you should always limit your PWM values to 254 -- NEVER allow them to be 255.

If you look at the output order, there is always a PWM value output between things that could possibly be a value of 255 (for instance you may want all relays ON, in this case relayA may be all 1's which is $FF or 255. If this was next to another thing, say relayB that could also be 255, the master CPU would think, "A HA, This is the start of the data stream" But, Innovation First cleverly put a PWM value in between RelayA and RelayB. So, the only way to make a "255, 255" sequience is to foolishly allow the PWM value to equal 255.

This problem can cause very subtle errors. MOST of the time everything is right as rain, then BOOM! Thunder and lighting! your code crashes.

Do yourself a favor, make sure you get good at limiting the values of your PWM outputs to 0-254.

Joe J.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PBASIC Syntax Question Raven_Writer Programming 4 20-08-2003 08:07
Question Obtaining Pbasic 2.5 PyroPhin Programming 3 18-01-2003 01:26
pbasic question Mike375 Programming 14 15-01-2003 06:54
PBasic Question Melissa H. Programming 28 17-11-2002 18:53
Another PBASIC Question Ian W. Programming 4 31-01-2002 21:36


All times are GMT -5. The time now is 08:23.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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