Comments on: Commodore 64: Fixing RS-232 Serial Limitations https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations Trains, computers, vintage, retro, model railways... the lot... Fri, 15 May 2020 17:25:31 +0000 hourly 1 https://wordpress.org/?v=6.4.3 By: Qus https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations/comment-page-1#comment-45333 Fri, 15 May 2020 17:25:31 +0000 http://modelrail.otenko.com/?p=4997#comment-45333 It would be great if this knowledge was preserved in any of the well known C64 wikis or other sources. I think this knowledge is priceless and can save a lot of WTFs

]]>
By: stevenh https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations/comment-page-1#comment-44776 Thu, 02 Apr 2020 02:27:26 +0000 http://modelrail.otenko.com/?p=4997#comment-44776 In reply to Kevin.

Kevin, thanks for the notes on this. My previous expectations of being able to send anything over the wire, however I liked, were obviously pretty naive!

I’ve recently interfaced with a scale at work via RS-232 and, whilst reading the doco, came across the fact that it was sending ‘control codes’. Of course, these are exactly what you’re speaking of and exactly what the C64 was interpreting!

I wish I’d know this at the start.

]]>
By: Kevin https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations/comment-page-1#comment-44775 Thu, 02 Apr 2020 02:07:07 +0000 http://modelrail.otenko.com/?p=4997#comment-44775 It seems that the c64 is almost binary transparent via rs232. The thing is; $00- $1f are control characters- very useful things to have. So we set up for transmission: $1b is the escape control code. if we want to send any binary number between $00- $1f we first preface it with the escape code $1b then the binary number EOR $20 is sent.
On reception if we receive $1b we throw it away, get the next character and EOR it by $20 and that’s binary transparency.
The cool thing is that all the other control codes when sent in the clear can be used to communicate out of band and control the receiver- the sky is the limit.

]]>
By: stevenh https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations/comment-page-1#comment-43179 Mon, 09 Sep 2019 13:01:34 +0000 http://modelrail.otenko.com/?p=4997#comment-43179 In reply to vbguyny.

vbguyny,

I’m really glad this blog helped out. That’s exactly what the site is for!
As for the fix, I wonder if Johan is interested… I think his goal is to be 100% compatible with the C64, so our hacks won’t be accepted :)
Meanwhile, anyone reading above should check out your comment.

Steven.

]]>
By: vbguyny https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations/comment-page-1#comment-43178 Sun, 08 Sep 2019 20:23:55 +0000 http://modelrail.otenko.com/?p=4997#comment-43178 This is an excellent article and it helped me with the same issue that I was having with my routines. I understand the need to block incoming serial communications but it should have been parameterized in the Kernal! That being said, I think I have found better way to implement non-blocking incoming serial communications:

Instead of calling jsr $ffcf, call jsr $f14e which basically does the same thing except that cmp #$00 check as you mentioned above. To check if there is no bytes to get from the buffer you would need to test $0297 and see if bit 3 is set. If so, this means that the buffer is empty and there is nothing to read. At this point you can exit your read routine and can do something like display an error to the user!

Code snippet:
;jsr $ffcf ; call CHRIN (get a byte from file)
JSR $F14E ; this won’t block the program if there is nothing to read. A will be 00 if nothing was read, otherwise A will be the byte read. See below about testing $0297

tax
lda $0297
and #%00001000 ; Is the RS-232 input buffer empty
beq @buffer_ok
jmp @done
@buffer_ok
txa

]]>
By: stevenh https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations/comment-page-1#comment-40581 Thu, 07 Jun 2018 00:26:26 +0000 http://modelrail.otenko.com/?p=4997#comment-40581 In reply to Bob.

Bob,
I love this! I didn’t know you could turn off the ROM. I had previously helped out with TTDPatch which was a wrapper to load Transport Tycoon Deluxe into memory and then perform surgery on it to do what we wanted. We added some great features; just like yours to BASIC :)
Thanks for the insight… makes me wish I didn’t pass the C64 on. Might have to get another or try the same trick with an Apple IIc.
Steven.

]]>
By: Bob https://modelrail.otenko.com/electronics/commodore-64-fixing-rs-232-serial-limitations/comment-page-1#comment-40580 Wed, 06 Jun 2018 10:15:11 +0000 http://modelrail.otenko.com/?p=4997#comment-40580 Just commenting on “Those bytes can’t be hacked”.

Back in 1986 I was messing with copying ROM to the RAM underneath, turning off ROM (via the special port on the 6510), and then messing with what was in RAM to change things. e.g. I once converted a BASIC statement (one of the DATA/READ/RESTORE set) to instead do something like scroll the text screen left one character. I forget exactly. (Pretty simple as it amounted to making it jump to my own routine in the spare 4k). The “Compute” book “Mapping the 64” was great for this. Also, I was messing with the lower BASIC ROM, not the upper Kernal ROM. So don’t know if this would work for you.

]]>