Mac68k Forums

Home


Welcome, Guest
Guest Settings
Help

Mac68k Forums » Development » Hardware Hacking

Thread: Localtalk bridge


Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 144 - Pages: 10 [ 1 2 3 4 5 | Next ] - Last Post: Apr 16, 2018 12:39 AM Last Post By: fraveydank
techknight

Posts: 110
Registered: 10/13/12
Localtalk bridge
Posted: Sep 22, 2013 10:40 PM
Click to report abuse...   Click to reply to this thread Reply
Well, I decided to mention this here as I noticed the thread got picked up a little bit over at 68kmla

For the SCC chip using SDLC, I happened to find a document from zilog that is an application note on how to implement localtalk, including their development board code.

http://www.zilog.com/appnotes_download.php?FromPage=DirectLink&dn=AN0064&ft=Application%20Note&f=YUhSMGNEb3ZMM2QzZHk1NmFXeHZaeTVqYjIwdlpHOWpjeTk2TVRnd0wyRndjRzV2ZEdWekwyeHZZM1JoYkdzdWNHUm0=
bbraun


Posts: 493
Registered: 7/25/12
Re: Localtalk bridge
Posted: Sep 22, 2013 11:24 PM   in response to: techknight in response to: techknight
Click to report abuse...   Click to reply to this thread Reply
Nice find, I'll need to read through it. I ordered a couple z53c80's in DIP form factor to experiment with some breadboarding, using the stm32f4discovery I've been using for the USB to ADB stuff. It'd be kind of nice to do localtalk to USB CDC interface or something.
bbraun


Posts: 493
Registered: 7/25/12
Re: Localtalk bridge
Posted: Sep 28, 2013 11:38 AM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
Also required:
RS422 line driver and receiver. TI used to make a single chip driver/receiver, but that doesn't seem to exist anymore. The IIgs used a 26LS30 driver and 26LS32 receiver. The 26LS30 doesn't seem to be available anymore, but the 26LS31 seems to be a reasonable replacement.
3.6864 MHz crystal. This gets fed into the /RTxC lines where it is internally divided by 16 to get the 230.4kHz of localtalk.
And probably a PCLK crystal to clock the SCC its self.
techknight

Posts: 110
Registered: 10/13/12
Re: Localtalk bridge
Posted: Sep 28, 2013 2:08 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
RS422 is RS485 at full duplex I think. as RS-485 is half-duplex differential bus. Unless of course RS422 runs at different voltages?
bbraun


Posts: 493
Registered: 7/25/12
Re: Localtalk bridge
Posted: Sep 28, 2013 2:29 PM   in response to: techknight in response to: techknight
Click to report abuse...   Click to reply to this thread Reply
Although they may be full duplex, there are rx+/- and tx+/- signals. rx needing a receiver, tx needing a driver. Duplex is just whether they can both be in use at the same time (they can).
There seems to be two sets of voltages for rs422 drivers/receivers, +/-7V and +/-15V. Oddly enough, the 26LS30 that the IIgs uses is a +/-10V driver, with the 26LS32 being a +/-7V receiver.
techknight

Posts: 110
Registered: 10/13/12
Re: Localtalk bridge
Posted: Sep 30, 2013 9:29 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
Thats what I thought. 2 RS-485 transceivers will work just fine. Use 1 set as a transmitter, and another set as a receiver. They are capable of handling up to +/-12V I think.

The lowest rated, cheapest quality is the ADM483. There are muuuuch better ones like MAX1487, and some SN74HC based ones. I forget what is what though.
bbraun


Posts: 493
Registered: 7/25/12
Re: Localtalk bridge
Posted: Sep 30, 2013 10:28 PM   in response to: techknight in response to: techknight
Click to report abuse...   Click to reply to this thread Reply
I see, I hadn't thought of that before. I've already ordered the 26LS driver/receiver, so I'll give that a go. If I run into trouble, I'll try out the rs485 transceiver approach.
dougg3

Posts: 190
Registered: 8/13/12
Re: Localtalk bridge
Posted: May 18, 2014 1:32 AM   in response to: techknight in response to: techknight
Click to report abuse...   Click to reply to this thread Reply
Attachment Scope5.png (51.0 K)
Attachment Scope4.png (46.3 K)
Attachment Scope3.png (71.7 K)
Attachment Scope2.png (62.7 K)
Attachment Scope1.png (45.4 K)
Attachment IMG_2319.jpg (56.8 K)
Attachment IMG_2318.jpg (67.8 K)
I've started to look into this. My main setback has been that I didn't have the tools necessary to start investigating and get a feel for the challenge at hand. I have a print copy of Inside AppleTalk on the way and I'm using a decent PDF version for now. I recently got a Rigol digital oscilloscope so now I can do some work on this. I have started by checking out what the EtherWave Printer Adapter does. The EtherWave will be helpful to look at because it is a working implementation of a LocalTalk-Ethernet bridge.

I got Mini Din-8 cables on Digi-Key that have a connector on one end and wires broken out on the other end. I got one female and one male version. Unfortunately they are 6 feet long each which is way more than I needed, not to mention expensive, but I'll deal with it. I soldered them to headers:







On some unused space on an SNES multitap breadboard I didn't want to tear apart, I hooked them up and gave myself some room to sniff some signals. I hooked up to the TxD- and RxD- signals. Through the EtherWave, I connected my IIci to my Linux Mac mini's netatalk server. I set up a trigger and then opened a folder on the server from the IIci.

Here's the initial capture of the data. All other pictures are derived from this same capture; I just zoomed in further and may have done slight fiddling with other knobs in the process. Yellow is TxD, blue is RxD.




Here's a zoomed version eliminating all of the emptiness on the right:




Here's the first group of frames:




I manually decoded them; it's an RTS from the IIci, followed by a CTS from the Mac mini, followed by an FPGetFileDirParms request from the IIci (encapsulated within an ATP packet, which itself is encapsulated within a DDP packet). Luckily we shouldn't need to delve this far into the protocol. I just decoded it to verify I was doing everything correctly.

To get an idea of how I decoded it, here's a zoomed version that shows the detail I'm looking at. You can see the synchronization pulse and idle period right before the beginning of the initial RTS frame. I'm not sure what's going on with the five "1" bits directly before the flag bytes (which start with the "0" bit on the right), but all of the frames began that way. Whatever...the SCC will sync to the flag bytes and then everything should be happy.




Finally, here's a byte between my vertical cursors (01000000, or 0x02 -- remember the bits are sent LSB first, this threw me off for a while!) You can see it's calculating the time between those two cursors as being 28.65 kHz. If we multiply that by 8, we get 229.2 kHz. Pretty close to LocalTalk's bit rate!




The waveform isn't very pretty, probably because of all the extra cable length and crap that I've added. In fact, if I put the EtherWave into the special mode that I believe clocks the SCC faster, it fails to work through the extra long breakout cable. If I can find some sort of smaller Mini Din-8 breakout board or something, I'll definitely grab one. Anyway, what I have now is more than good enough to look at the data at the standard 230.4 kbps LocalTalk rate, and that's the important part.

In conclusion, this was a fun experiment. The scope has a ton of memory so I can zoom in and see some pretty good detail. As has already been said, it would be pretty crazy to try to bit-bang this stuff. I think some of the stuff that synchronizes to the frames is handled automatically by the SCC and it would take some work to replicate that logic. Next up, I guess I'll wire up RS-422/485 transceiver(s) + Z85C30 SCC + ARM microcontroller to listen in on this traffic and spit it out already decoded. If I can get communication with the SCC working and start sniffing LocalTalk packets, that's a good chunk of the battle! I think that document linked by techknight will help with configuring the SCC.
bbraun


Posts: 493
Registered: 7/25/12
Re: Localtalk bridge
Posted: May 19, 2014 10:47 PM   in response to: dougg3 in response to: dougg3
Click to report abuse...   Click to reply to this thread Reply
Very awesome! I'm glad someone is finally looking into it!
dougg3

Posts: 190
Registered: 8/13/12
Re: Localtalk bridge
Posted: May 20, 2014 12:56 AM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
Thanks! Yeah, I'm excited to make some progress on this.

Yesterday I designed and ordered my own Mini-DIN-8 breakout board because I couldn't find anything that would fit my needs. It has female Mini-DIN-8 sockets on each side hooked together, so it's like a short female-to-female cable that breaks out access to each signal on a pin header and provides convenient locations for clipping onto ground. I should be able to put this in line with my EtherWave to get a much higher-quality signal. Hopefully it'll be able to see what's going on with the faster clock mode. I even meandered the traces so they're all the same length, although I don't think it matters at this bit rate :)

Should work, but it's untested as of yet.

http://oshpark.com/shared_projects/ey1EBH8f
bbraun


Posts: 493
Registered: 7/25/12
Re: Localtalk bridge
Posted: May 20, 2014 4:05 PM   in response to: dougg3 in response to: dougg3
Click to report abuse...   Click to reply to this thread Reply
Nice idea with the breakout board. I wonder if I can use it as-is for ADB and PS2 connectors... It sure looks like my PS2 sockets would fit, there would just be a couple extra traces.
dougg3

Posts: 190
Registered: 8/13/12
Re: Localtalk bridge
Posted: May 20, 2014 7:48 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
Ooh, I never thought of that. Looks like it would work just fine! I just overlaid the PCB layouts for 4-pin, 6-pin, and 8-pin connectors on top of each other and the holes all overlap. I see no reason why it wouldn't work. If you'd like a board, I'd be happy to send one your way when I receive them. I won't have use for all three.
techknight

Posts: 110
Registered: 10/13/12
Re: Localtalk bridge
Posted: May 27, 2014 8:26 PM   in response to: dougg3 in response to: dougg3
Click to report abuse...   Click to reply to this thread Reply
This is awesome.

I did read the Inside Appletalk, and found a newer one that goes heavily into ethertalk as well. The frames are entirely different, but the payload is the same it appears. So Once we get the SCC decoding and spitting out the LLAP frames, we need to figure out how to encapsulate those into ethertalk frames somehow. Not to mention we need to parse the link layer on the ethernet side as well, getting the mac addresses to and fro correct.

Message was edited by: techknight
dougg3

Posts: 190
Registered: 8/13/12
Re: Localtalk bridge
Posted: May 28, 2014 10:30 PM   in response to: techknight in response to: techknight
Click to report abuse...   Click to reply to this thread Reply
Yeah, it'll be some work. My copy of Inside AppleTalk just arrived today and has some diagrams that the PDF version did not have. It looks to me like the main idea behind this is going to be converting LLAP frames to and from ELAP frames. I'm hoping that the frames will mainly just directly convert between each other but there might be weirdness with how LLAP and ELAP addressing work and the translation between the two--haven't gotten that far yet into the AARP stuff. Anyway, once we have that working, we can implement the MacIP server.

I've been investigating the SCC documentation. I have a few Z85C30 chips here in DIP form so I can do some breadboarding. Umm...all I can say is it's a very complicated chip. It's going to take some serious work to do anything with it, starting with interfacing to it. I'll need to get both read and write cycles working correctly with it so I can configure it before I'll be able to sniff any packets. It looks like the chip has to be clocked, so I'm going to need an oscillator to run the chip. The chips I have can handle 8 MHz max. I also am pretty sure the LocalTalk bit rate (230.4 kbps) will require a 3.6864 MHz clock, unless there are special divider things I haven't figured out yet. So I have to decide if running the SCC with a 3.6864 MHz oscillator will work well enough, and if not, I'll have to use a faster oscillator for the SCC's main clock (which is a TTL level input) and a separate crystal for its baud rate stuff -- I believe you can configure two pins to handle the amplifier circuit for just using a crystal for that.

The linked PDF is scaring me a little bit because it's talking about how difficult it is to meet some timing requirements, as well as how some things have to be timed because the SCC won't let us know what's going on. And that's on a processor/SCC combo chip that has the whole mess integrated together. It's also talking about how DMA might be needed in cases where the processor also has other things to do. I'll be curious to see how intensive the processor usage will be for both it and the Ethernet code. The good news is that this PDF was written before cheap 100 MHz ARM microcontrollers were a thing, so my worries may not even matter today.

I'm definitely getting this working as LLAP<->ELAP at the standard 230.4 kbps rate before even thinking about higher clocks, MacIP, and fun stuff like that.
bbraun


Posts: 493
Registered: 7/25/12
Re: Localtalk bridge
Posted: May 29, 2014 11:13 AM   in response to: dougg3 in response to: dougg3
Click to report abuse...   Click to reply to this thread Reply
Awesome! FWIW, the appletalk vpn does the translation between ELAP and LLAP, since the VPN side is essentially just LLAP. It may not be entirely applicable, since the avpn does a sort of NATing, but it doesn't seem too bad.

For the SCC, I'm sure there's a lot of timing requirements, but also keep in mind the 8mhz 68000 interfaced with the SCC for localtalk, so there might be tricks, but it doesn't seem that bad... I hope. :)

Point your RSS reader here for a feed of the latest messages in all forums