Go to Post My friend Noah said he talked to someone that knew me from Chiefdelphi. That's just creepy. - Adam Y. [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Spotlight this post!  
Unread 02-06-2002, 20:45
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
There's all kinds of tricks you can pull to cram more data through those 8 bits. If you need to send back two values, you can use one of those bits to indicate which value you are sending, then use the other 7 bits as the value. For instance, use the most significant bit as the value selector:

Bits
7 6 5 4 3 2 1 0
----------------------
0 0 0 0 0 0 0 1 = Variable A = 1
1 0 0 0 0 0 0 1 = Variable B = 1

This way you can send back a number between 0 and 127 for each variable and just alternate which one you send. You can carry this idea further and trade a bit of precision for another power of 2 of variables, i.e. 6 bits for the value, 2 bits for the variable number, etc.

If you need to send back lots of values and only need to do so a couple times a second, you could something like this: Send the values 0xFF, 0x01, 0xFE, 0x26, 0xFF, 0x02, 0xFE, 0x67... In this sequence, 0xFF is an attention signal: it means that the next number will be the variable number. Then 0xFE is another attention signal and means that the following number is the variable data. So the above sequence tells you that variable 1 == 0x26 and variable 2 == 0x67. Now obviously you can't use 0xFF and 0XFE as either a variable number of a variable value. The downside to this is that it takes 4 dashboard packets to send each value, so you can only send 10 variables a second. There's also a problem which is that you don't know exactly when the master CPU is going to send a packet, so you can't really send 40 different bytes a second. Probably it's more like 10-15 bytes a second, so using this method you could maybe send like 2 to 4 variables per second.

Anyway, I hope this gives you some ideas. Basically you can do a lot with 8 bits by trading either time or precision. Sorry for rambling on so long
 


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
Creating a dashboard program Jeff_Rice Programming 18 04-05-2003 23:21
Anyone looking for more program space? archiver 2001 13 24-06-2002 02:20
Custom dashboard program available. Interest? archiver 2001 4 24-06-2002 00:45
miroboworks dashboard program? archiver 2000 3 23-06-2002 23:04
Yet another dashboard program Neal Probert Programming 3 12-05-2002 10:43


All times are GMT -5. The time now is 21:20.

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