Jump to content

Photo

A workaround for the UART bug


24 replies to this topic

#1 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • 2,756 posts
  • Location:France

Posted Sat Jun 16, 2007 1:00 PM

Here's a little idea I had to circumvent the Jaguar's UART bug. ;)

The ZIP file contains a detailed description and a demo program (the source code is included). It's available in this post on Jagware (no registration required).

Enjoy !

Edited by Zerosquare, Sun Jun 17, 2007 3:57 PM.


#2 Matthias OFFLINE  

Matthias

    Stargunner

  • 1,171 posts
  • Location:Germany

Posted Sat Jun 16, 2007 1:46 PM

Hello!

Here's a little idea I had to circumvent the Jaguar's UART bug. ;)

The ZIP file contains a detailed description and a demo program (the source code is included).


Thanks for sharing this :)

The idea sounds interesting, and to be honest i didn't know about the described option to read the data-stream while avoiding to use the receiver.

I have just tested the example program, it works as described (although the blank black screen on the Jaguar irritated me first), but sadly sending a stream of data shows the drop-outs as described in the README.TXT, but the positive thing is, that the Jaguar never crashed when receiving the stream (i sent 800 ASCIIs using Hyperterminals "Send Text-file"-option).

What i really like in this approach is, that everything is done inside the (receiving) Jaguar, no need to change the serial transmission itself (like using more or less STOP-bits, or sending the data-bytes spread over more than just 8 serial-data-bits).

Kind regards
Matthias

#3 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • Topic Starter
  • 2,756 posts
  • Location:France

Posted Sat Jun 16, 2007 2:08 PM

I'm glad you like it. :)

The drop-out problem can be easily fixed by implementing a buffer, it's just that I was too lazy to code it ;)
(same thing for the black screen)

#4 Matthias OFFLINE  

Matthias

    Stargunner

  • 1,171 posts
  • Location:Germany

Posted Sat Jun 16, 2007 2:33 PM

Hi!

I'm glad you like it. :)

The drop-out problem can be easily fixed by implementing a buffer, it's just that I was too lazy to code it ;)
(same thing for the black screen)


Don't be so lazy, post a second example with a buffer tomorrow ;)

BTW:
The "MAKEFILE" in your ZIP is more like a DOS-Batch-file, i renamed it to "M.BAT" in my environment.

Regards
Matthias

#5 Gorf OFFLINE  

Gorf

    River Patroller

  • 4,633 posts

Posted Sat Jun 16, 2007 7:49 PM

Here's a little idea I had to circumvent the Jaguar's UART bug. ;)

The ZIP file contains a detailed description and a demo program (the source code is included).

Enjoy !


All the interesting code runs on the DSP ; the 68000 is only used as a bootstrap, then stopped
immediately after so it doesn't hog the bus (maybe that's not really necessary, but hey ;)


Amen to that..it is nice to see others using coding practices like this on the jag. Good work.
that is how it should be.
:)

Nice work!

#6 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • Topic Starter
  • 2,756 posts
  • Location:France

Posted Sun Jun 17, 2007 4:25 AM

Thanks, Gorf. :)

#7 SebRmv OFFLINE  

SebRmv

    Moonsweeper

  • 304 posts
  • Location:Paris, France

Posted Sun Jun 17, 2007 2:24 PM

Thanks for sharing this, Zerosquare!

#8 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • Topic Starter
  • 2,756 posts
  • Location:France

Posted Sun Jun 17, 2007 3:55 PM

Well Matthias, I listened to you :)

Version 1.01 is ready. It can be downloaded by clicking on the link in the first post of this topic.

Here are the changes :
- Fixed a few bugs
- Fixed the "dropped characters" issue (by adding a 1 MB circular buffer... I hope it's enough for you ! :D)
- Made the screen green (see ? no more black screen :cool: )
- Renamed Makefile to Makefile.bat (you were right, it's actually a batch file)

Oh, and I've credited you in the changelog as well ;)

I've made a few tests by transferring a ~100 kB text file several times(and temporarily disabling the "add one to the character" to get a readable echo), it seems that no characters get dropped or corrupted.

#9 JagChris OFFLINE  

JagChris

    River Patroller

  • 3,640 posts
  • Location:Oregon

Posted Sun Jun 17, 2007 6:58 PM

This is nice to see other developers actually tackling this problem. Good stuff. :)

#10 viMaster OFFLINE  

viMaster

    Moonsweeper

  • 371 posts

Posted Sun Jun 17, 2007 7:22 PM

Wow. It's great that someone else has been able to find a possible workaround that could be used for future development.

... and to make the findings available to everyone is definitely a great thing and will hopefully inspire someone to make optimizations and changes to make it fully usable :)

#11 Pocket OFFLINE  

Pocket

    Dragonstomper

  • 945 posts

Posted Mon Jun 18, 2007 1:13 AM

Nice work Zero, thanks for sharing your work to everyone :)

#12 Matthias OFFLINE  

Matthias

    Stargunner

  • 1,171 posts
  • Location:Germany

Posted Mon Jun 18, 2007 9:56 AM

Hello Zerosquare!

Well Matthias, I listened to you :)

Version 1.01 is ready. It can be downloaded by clicking on the link in the first post of this topic.


Ok, thanks :-)

Kind regards
Matthias

#13 TXG/MNX OFFLINE  

TXG/MNX

    River Patroller

  • 3,633 posts

Posted Mon Jun 18, 2007 11:11 AM

when to see a fix for doom ? :cool:

#14 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • Topic Starter
  • 2,756 posts
  • Location:France

Posted Mon Jun 18, 2007 11:15 AM

when to see a fix for doom ? :cool:

I was waiting for someone to ask this :D
I'm not interested in DOOM myself, but if anyone wants to do it, I can help.

#15 belboz OFFLINE  

belboz

    Moonsweeper

  • 413 posts
  • Location:Ohio

Posted Tue Jun 19, 2007 12:36 PM

How fast have you been able to get the software UART to be reliable at?

I did a software UART on the Jag a couple years ago when flirting with my serial based download program (a CD based JUGGS).

I was able to get 19200 and 38400 baud working well enough with the software UART.

I dropped the idea because I had no problems with 38400 and slower on the built in Jag serial port, so I didn't see the value in a software UART that wasn't getting me any faster speeds. Plus for my serial download application I wanted 115200.

#16 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • Topic Starter
  • 2,756 posts
  • Location:France

Posted Tue Jun 19, 2007 2:11 PM

How fast have you been able to get the software UART to be reliable at?

For the moment, I only tested my code at 9600 bps to verify that the implementation was working okay... The maximum speed would depend on how many cycles per second you'd allocate to the software UART, of course.

I did a software UART on the Jag a couple years ago when flirting with my serial based download program (a CD based JUGGS).

Were you involved in the original JUGS, or did you reverse-engineer the protocol ?

I dropped the idea because I had no problems with 38400 and slower on the built in Jag serial port

That's very interesting ! So you found a way to avoid the UART bug too ?

#17 Tempest OFFLINE  

Tempest

    Fallen Moderator

  • 27,124 posts
  • Location:Dark Places

Posted Tue Jun 19, 2007 2:24 PM

Anyone want to share with us non-Jag programmers exactly what the UART bug is? From what I can gather it has something to do with the networking code. That would explain why Doom flakes out during deathmatches half the time.

Tempest

#18 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • Topic Starter
  • 2,756 posts
  • Location:France

Posted Tue Jun 19, 2007 2:52 PM

Anyone want to share with us non-Jag programmers exactly what the UART bug is? From what I can gather it has something to do with the networking code.

Yes, the UART is the part of the Jaguar chipset which handles the networking. Due to a design error, it tends to malfunction and lock up, which halts the communication between consoles. There is a workaround mentioned in Atari's developers documentation, but it seems that it is not sufficient to avoid all problems.

#19 Zerosquare OFFLINE  

Zerosquare

    River Patroller

  • Topic Starter
  • 2,756 posts
  • Location:France

Posted Tue Jun 19, 2007 3:43 PM

BTW, just did some testing : my code seems to work fine at 115,200 bps. :)

#20 belboz OFFLINE  

belboz

    Moonsweeper

  • 413 posts
  • Location:Ohio

Posted Tue Jun 19, 2007 4:57 PM

Were you involved in the original JUGS, or did you reverse-engineer the protocol ?


No. My protocol was my own. I was going to release the software on my website for a BJL alternative for the masses.

That's very interesting ! So you found a way to avoid the UART bug too ?


I would say I was able to avoid most bugs as long as I stayed at or below 38400.

Biggest thing I found was that it looked like no matter what you always got even or odd parity with the jag. I noticed when I configured my PC accordingly I could send large packets to the Jag no problem. As you mentioned sending from the Jag was no problem regardless.

Once I made sure I had the parity right (even or odd depending on how I configured the jag, and never set to none) things worked great. I did follow the info in Atari dev docs also when it came to avoiding the bug they mention.

I pretty much had rock solid 38400 and below after doing the above.

Since you mentioned your code works at 115200 I will have to give my download CD another go.

#21 walter_J64bit OFFLINE  

walter_J64bit

    Quadrunner

  • 5,200 posts
  • Location:Goldsboro NC

Posted Tue Jun 19, 2007 8:36 PM

WOW, we might have working deathmatches for DOOM! :love:

Edited by walter_J64bit, Tue Jun 19, 2007 8:37 PM.


#22 Gorf OFFLINE  

Gorf

    River Patroller

  • 4,633 posts

Posted Tue Jun 19, 2007 9:13 PM

Anyone want to share with us non-Jag programmers exactly what the UART bug is? From what I can gather it has something to do with the networking code. That would explain why Doom flakes out during deathmatches half the time.

Tempest



Its a real cheap UART that they put in there and they never bothered to debug it.
IT completely locks up the Jaguar to the point where you have to reboot. There are
workarounds being developed other than the current ones that exist.

#23 viMaster OFFLINE  

viMaster

    Moonsweeper

  • 371 posts

Posted Wed Jun 20, 2007 12:56 AM

Anyone want to share with us non-Jag programmers exactly what the UART bug is? From what I can gather it has something to do with the networking code. That would explain why Doom flakes out during deathmatches half the time.

Tempest

There are
workarounds being developed other than the current ones that exist.

The more the merrier!

#24 Tempest OFFLINE  

Tempest

    Fallen Moderator

  • 27,124 posts
  • Location:Dark Places

Posted Wed Jun 20, 2007 7:26 AM

Its a real cheap UART that they put in there and they never bothered to debug it.


Atari Corp. cheap? Never! :roll: :D

Tempest

#25 TXG/MNX OFFLINE  

TXG/MNX

    River Patroller

  • 3,633 posts

Posted Sat Jun 23, 2007 1:54 AM

Were you involved in the original JUGS, or did you reverse-engineer the protocol ?


No. My protocol was my own. I was going to release the software on my website for a BJL alternative for the masses.

That's very interesting ! So you found a way to avoid the UART bug too ?


I would say I was able to avoid most bugs as long as I stayed at or below 38400.

Biggest thing I found was that it looked like no matter what you always got even or odd parity with the jag. I noticed when I configured my PC accordingly I could send large packets to the Jag no problem. As you mentioned sending from the Jag was no problem regardless.

Once I made sure I had the parity right (even or odd depending on how I configured the jag, and never set to none) things worked great. I did follow the info in Atari dev docs also when it came to avoiding the bug they mention.

I pretty much had rock solid 38400 and below after doing the above.

Since you mentioned your code works at 115200 I will have to give my download CD another go.


Will you release your version of aswell? All extra info would be nice...




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users