MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 140 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10  Next
Author Message
 Post subject:
PostPosted: Wed 11 Oct, 2006 3:19 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
Well, that's pretty much the idea of networking ;) Enabling calculators to send data to a specific other calculator. Only difference is that I don't plan on having them alternate every bit, but every stream. So calculator one can send a stream of bytes specifically to calculator two, and when it's done calculator three can send a stream to calculator four.

_________________
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 3:25 pm 
Offline
New Member
User avatar

Joined: Fri 17 Feb, 2006 9:14 pm
Posts: 38
Location: Jersey City, NJ
sorr to double-post... but my previous message was written in a hurry before rushing off to class... What I was proposing is the following:
We have 4 calculators on the network. Usually if calc 1 is sending/receiving bytes to/from calc 2, calcs 3 and 4 have to sit idly by, waiting to be able to communicate. Let's say that calc 1 needs to send bytes $80, $40, $20, $10 to calc 2 and that calc 3 needs to send $80, $40, $10, $20... calc 1's bytes (in binary) are
%1000 0000, %0100 0000, %0010 0000, %0001 0000
and calc 3's bytes are
%1000 0000, %0100 0000, %0001 0000, %0010 0000 ... so we alternate between the two calcs when sending the bits... and the total communication on the network becomes:
%11000000 00000000 00110000 00000000 00001001 00000000 00000110 00000000
or $C0 00 30 00 09 00 06 00
(I alternated between reading a bit from calc 1's data, and calc 3's data)

I'm not sure if this is better than just having calc 3 wait to send its bytes as soon as calc 1 is done, but it will at least balance the load so that no calc is waiting (doing nothing) while only two calcs on the network are communicating... I know I like it how Firefox actually shows you pictures while they're still being downloaded as opposed to IE not showing you a picture until it's been fully DLed... same thing but for the calcs... I think it'd be better for the calcs to be "doing something" (such as communicating at a slower speed) than for the communication on the network to be queued (since we would then also need a queue manager, wouldn't we)

I hope I made some sort of sense...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 3:47 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
I see your point of view, but I disagree. The idea is that all calculators will be running an interrupt routine that blocks the calculator as soon as it starts receiving something. Because of this, we can "lock" all calculators in their roles:

Calc 1 starts sending, which disables interrupts
Calc 2 starts receiving, which blocks normal operation (so it can't start sending)
Calc 3 starts listening (but ignoring the data), which also blocks
Calc 4 starts listening (but ignoring the data), which also blocks

So at all times when data is sent, we have guaranteed that we have only one sender, which is crucial for proper transfer. It would be possible to implement your idea, but it would be far from functional because of the above structure. I'd have to make a sort of hybrid between sending and receiving because all sending calculators can also be listening to other data streams. Also, it would require a lot of negotiating between senders (what if all four calculators want to send data? Do you plan to multiplex that too? Who'd be receiving then?) which only ADDS more delay.

Finally, your reason for suggesting this isn't valid either because of the above structure. All calculators are locked in their roles as long as there is data being sent on the network, so all four calculators will have to wait untill ALL data is sent, not just the data that's meant for them.

In short: it'll just make the software more complex (larger) and the network slower, without actually adding anything positive. The only way it could work is if we treat the interrupt routine as a seperate thread that handles incoming data without blocking the program, but the data transfer speed would have to be significantly slower then, and you'd get all sorts of annoying locks. Plus most applications will not start to process the data as long as it hasn't been received entirely, so again it wouldn't add anything.

_________________
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 4:33 pm 
Offline
Calc Wizard
User avatar

Joined: Tue 05 Jul, 2005 11:28 pm
Posts: 549
Just to back Timendus and his correctness up, it's precisely the way the interrupt send/rec routine in Cn2 works as well.

_________________
Image Image Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 5:20 pm 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
But as we know Ben can make his calc multithread so.. What if you let sending/receiving run together with some main program? If so don't forget to let it set a flag somewhere that teh data is being changed and thus should be not be used/changed etc etc..
If this would be my idea then it would be bad, but it actually isn't so it might even work... (although a little slower for each calc, it might be faster overall since you would not have to lock calcs that have nothing to do with a certain transfer)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 6:31 pm 
Offline
Calc Wizard
User avatar

Joined: Tue 05 Jul, 2005 11:28 pm
Posts: 549
But look, there's only one linkport, and no way to distinguish one of the network "layers" from the other without listening to packets and looking for some kind of identifier. As Timendus said, this takes many additional clock cycles, and is therefore impractical. There's no real point to trying to isolate different streams of data between the same two nodes on the same network.

_________________
Image Image Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 6:46 pm 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
well 84's have 2 ports, but it doesnt really matter since it would be completely impractical and slow so..
but if someone would make some program that would be like BASIC's GetCalc( with the difference that it will work when the other calculator is in a loop then Im sure I could make 84's network. I allready tried it but ofcourse it didnt work since those bloody calcs dont respond to silent link when they're busy.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 6:54 pm 
Offline
Calc Wizard
User avatar

Joined: Tue 05 Jul, 2005 11:28 pm
Posts: 549
Umm, mainly because GetCalc() only works between two calcs, not multiples.

_________________
Image Image Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 7:02 pm 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
does, it takes 2 arguments of which 1 optional, the second is which link port you would want to use, so it could be connected to 2 other calcs.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 8:21 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
King Harold wrote:
But as we know Ben can make his calc multithread so.. What if you let sending/receiving run together with some main program?

Ben's "multithreading" is realized through interrupts, so all of the above applies. To explain it in a more understandeable way: you have two programs both running half the time. If one of your programs is communicating with another calculator, it'd miss half of the bits it receives. Or, since the other calculator is also running it's link software half the time, they could miss each other all the time and they'd receive nothing.

Quote:
it might be faster overall since you would not have to lock calcs that have nothing to do with a certain transfer

You're theoretically correct here, but it's pretty much impossible, as explained above. Also, you're talking about the speed of execution, where we are talking about the transferspeed, which would be much lower than in my solution. Now I think of it, execution speed would also get worse as you'd only have half the CPU time, compared to 99% CPU time if you're not receiving anything in my solution. The only thing you'd improve is the reliability of the execution speed, which can drop to 0% on reception versus the same 50% in your idea...

About chaining Ti-84s, like I said that is not one of my goals. I don't have one, don't know anything about the USB port, don't want to get into routing, and want to stay compatible with calculators without a USB port.

_________________
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 9:09 pm 
Offline
Calc Wizard
User avatar

Joined: Tue 05 Jul, 2005 11:28 pm
Posts: 549
Slightly offtopic, but it turns out I may have had incorrect equates. Have I massively confused myself here?

Code:
SendCLDL      .equ   $D0
SendCHDL      .equ   $D1
SendCLDH      .equ   $D2
SendCHDH      .equ   $D3

ClockMask      .equ   $01
ClockHigh      .equ   $00
ClockLow      .equ   $01

DataMask      .equ   $02
DataHigh      .equ   $00
DataLow         .equ   $02

LinkMask      .equ    $03
GetCLDL         .equ   $03
GetCHDL         .equ   $02
GetCLDH         .equ   $01
GetCHDH         .equ   $00
(Not a topic hijack, btw, just thought getting this straightened out once and for all might help anyone trying to do link stuff)

_________________
Image Image Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 9:21 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
Which calculator are we talking about, why don't you check the Wiki or the CLAP source, and I was under the impression that I had "straightened that out" four years ago :)

_________________
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Oct, 2006 9:27 pm 
Offline
Calc Wizard
User avatar

Joined: Tue 05 Jul, 2005 11:28 pm
Posts: 549
I was using $04 and $08 for data and clock read values, respectively, but then I tried outputting the link port read value to the screen and bits 0 and 1 were getting set. I'll take a look at the wiki.

Edit: oh, and I refuse to look at the CLAP source in case I accidentally see code to give me ideas.

Edit#2: Got it all straight now. Ty.

_________________
Image Image Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 12 Oct, 2006 12:00 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
Not to be childish or anything, but I was under the impression that you've been coding link related things for ages..? At least that's what you've made us all to believe. Seems a bit odd that you don't have a bit of source of a few defines lying around from previous projects...

_________________
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 12 Oct, 2006 12:25 pm 
Offline
Calc Wizard
User avatar

Joined: Tue 05 Jul, 2005 11:28 pm
Posts: 549
Yeah, and I was coding them on the TI-83, which used the D0...D3 values, which didn't seem to be working on the 83+. Now I know why.

_________________
Image Image Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 140 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt