Closed okwatts closed 11 months ago
Hi okwatts! Thanks for confirming you've at least got it to a bootable state.
I haven't been able to replicate the TIME problem, but I can confirm that INPUT locks up on the main branch program.Since the same problem doesn't happen on the emulator, my guess is that it's a problem with the LCD/Keyboard routines.
I'll have an investigation on the weekend.
Thanks yes I think the TIME thing is better with the latest update. The input issue is frustrating. Looking forward to hearing from you after you have a chance to look at it.
On Thu, Nov 30, 2023, 5:30 p.m. Chelsea Wilkinson @.***> wrote:
Hi okwatts! Thanks for confirming you've at least got it to a bootable state.
I haven't been able to replicate the TIME problem, but I can confirm that INPUT locks up on the main branch program. I'll have an investigation on the weekend.
— Reply to this email directly, view it on GitHub https://github.com/chelsea6502/BeebEater/issues/12#issuecomment-1835258636, or unsubscribe https://github.com/notifications/unsubscribe-auth/APALSOIYSVXP65BHL7NNGZTYHEXKNAVCNFSM6AAAAABAB4IXPWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZVGI2TQNRTGY . You are receiving this because you authored the thread.Message ID: @.***>
Okay! I think I figured it out! The problem was that I was not restoring the A, X and Y registers after exiting from the 'OSWORD0V' routine.
I've just pushed a fix for it now in the main branch, plus a few other tidy-ups. Let me know if that does it for you.
Hi I was working on checking your update when my computer on which I was working seems to have failed. I've tried a number of things but so far haven't been able to resurrect it. While I was testing it appears that at least in small programs the INPUT issue is fixed. I tried the TIME issue and it works the first time through and then doesn't advance the time unless I reset. I then tried to test the INPUT on a larger program and had issues. About the that time the computer just quit responding. It's possible the last few issues may have been due to an imminent impending failure but I can't tell until I can get this sorted. I have tried a number of chip replacements and even replaced the crystal and cap for the 1.8MHz ACIA clock but so far nothing shows even when I go back to my other EEPROM application. I will have to try a more rigorous approach with a logic analyzer to see what is failing. I'll let you know if and when I can continue.
hmmm....I haven't been able to replicate the TIME issue. It's interesting that calling TIME seems to pause it. Are you using the WDC 65c02, by any chance?
One issue that might be impacting your program is how it pastes into Coolterm. I find that it often skips characters. I'm about to push an update that has larger delays when sending characters. Pasting is slower, but it's more reliable.
One more thing you could try: Tie the ACIA Pins 16 (DCDB) and 17 (DSRB) to ground. I found those floating pins cause unwanted interrupts and locked input.
Let me know if those suggestions work, or if you find any more info about it.
PS: OMG I had no idea about the OLD command! That's going to save me a ton of time re-typing things after a reset!
Okay resurrected the computer (killed 2 ACIA's (at least the part that connects to the crystal and causes it to oscillate) have to try with an external oscillator to see if that fixes the transmit). If I run this little program to test things, it works after I hit reset and OLD. when I interrupt with ESC and rerun it then TIME doesn't increment in the program. But TIME at the prompt after the ESC gives a later time than Q or Q1. 10 Q=TIME 20 FOR X = 1 TO 10000 30 NEXT X 40 Q1=TIME 50 PRINT (Q1-Q)/100 60 INPUT"GIVE ME A NUMBER",A 70 PRINT A 80 INPUT "GIVE ME A STRING", A$ 90 PRINT A$ 100 GOTO 10 Hope that helps discern whether it is my problem or yours. Thanks
Oh I'm using a 65C02 and those pins are connected fine.
I can confirm I get the same issue too. I've attached screenshots below.
I'll have an investigate tonight. I'm very sure it's something to do with the escape handling that's causing TIME to bug out. OSESC initialises to 0 at boot, but it's 0x7F after the escape key is pressed. Another guess is that the VIA or ACIA is constantly calling for an interrupt, which is causing the 6502 to never reach the timer increment routine in the IRQ handler.
Thanks for this. It's interesting!
Side note: Last night I pushed a major update to the main branch. Make sure you've pulled those changes in.
Hi again, starting investigation now. I'm trying to get a bit more clarity on that program you've got there.
What I'm guessing it's for is to time the seconds between the start and the end of the inputs. However, if you have '100 GOTO 10', Q is going to get reassigned to almost always be equal to Q1.
If you change it to 100 GOTO 20, it seems to be more in line with what I imagine you're trying to do:
Okay, I found the issue! I put an 'SEI' at the start of the OSWORD routine, which means that the timer never gets incremented while that is set.
I've pushed an update to the main branch that changes the 'SEI' to a 'CLI'. Give that a try, and let me know if it works for you.
I'm unsure what the implications are for enabling interrupts here, so I'll keep an eye out for any issues that may arise.
Hi the new version doesn't really fix the issue. The program is intended to time the for next loop. The extra was just to confirm that input still behaved. I now see the a time printed of 1e-2 (I'm running at 4Mhz and have corrected the Timer variable to still get a 100Hz clock tick). I do also to see an occasional odd character on printout to the screen( not sure of the ascii code but a vertical bar with a right segment in the middle this looks to be in place of the CR). Then also after reset and OLD when the correct time is being shown the ESC key works almost immediately but when the wrong time is shown it takes some time for the ESC to be recognized.
I'm not sure if this helps but in your first update to me dated Nov 25 the time functioned properly whether ESC was used or not. The next update fixed the input issue but then the time changed after hitting ESC. Thanks for trying on this.
hmmm...I also get 1E-2 but I figured it made sense, as Q1 is always set immediately after Q. It's likely just 1/100. Does it still happen when to change 100 GOTO 10 to 100 GOTO 20?
I've also been battling garbled characters on my RS-232, especially when trying to paste things. See #21 for details on that.
You might be getting garbled character in the new lines because the ACIA doesn't have time to fully transmit at 4mhz. Try adding a >1ms delay in the OSWRCHV routine and see if that helps. Note that I'm only supporting 1mhz.
I'll look into all of these. Thanks!
I found some glaring issues in the BRKV handler! I wasn't properly restoring and saving the X and A registers. This caused funny issues after an escape, such as it being much slower.
I've just pushed a fix for it now. If it fixes some of your issues, let me know.
Hi Yes that seems to have fixed the issue with TIME after an ESC. I will continue to test with other programs to see if I run across any other issues.
Fantastic! I'll close this one.
If you find more issues, create a new issue and we'll restart the discussion.
Hi, I noted your posting on 6502.org and have been trying it out on another SBC which is similar in Hardware to BenEater's. I don't have the LCD or PS2 so have grounded the ports for my VIA. Essentially I have 32 K less the top page which is for I/O hence VIA is located at $7f60 and ACIA at $7f70. I have changed the HiMem to $7f00 and can start and enter programs. I was having problems with the TIME working inside programs whereas it worked from the prompt. It appears to work now but occasionally I have had to hit reset and it works. I can type in and run an ASCII Mandelbrot program but if I try and capture input using the INPUT statement the system locks up after hitting return and needs to be reset. I can recover programs using the OLD command. So my question is whether there is an issue with accepting user input using the INPUT statement on Ben Eater's hardware? Or is this an issue in porting to my SBC.