IO Board completed and installed; question about uptime word

Hello, I’ve finished the IO board and I’ve installed it. I can use the LED control words (vslights, etc) and they seem to work, so at least part of the board is functioning! However, I cannot get “uptime” to work. As I understand it, It should use one of the timers in the 6522 to give an uptime for the system.

It’s defined as : uptime time @ 2 time + @ 200 um/mod s>d 60 um/mod s>d 60 um/mod cr . ." h " . ." m " . ." ," 2/ . ." s" cr ;

In my case, uptime always returns something like: -1 h 59 m 59 ,-12076 s

When I do time ., it returns 8, which I assume is $08 in the zero page. I’ve looked at the data in the zero page, but I don’t see any change, which makes me wonder if the timer on the 6522 is not being started? Is this a hardware problem on my side? Not sure what to do next.

Does anyone have any suggestions about how to get uptime to work?

Hi Ben,
Make sure that the timer code is included in the main.s file, it should look like this:
.include "drivers/timer.s"

Otherwise, you can try and send some debug information via serial in the IRQ handler, to see if if the timer interrupt is called.

Hi Jonathan,

Thanks for the reply - I can see that the timer.s code is in the planck-listing.txt, and I’ve also located it in the code on the ROM (it’s at $22D to $24D), so that doesn’t seem to be the problem. I will keep digging.

I also have not had any luck with the PS/2 keyboard port yet. To be sure I’m understanding how it works, the system should accept input from the PS/2 port, even if I’m connected via serial to my machine via minicom, correct?

You have to activate the PS/2 keyboard by uncommenting the .include "drivers/ps2.inc" line in main.s, which you have probably done already. If that is done, you should at least get a line printed out that says “Detecting keyboard”. In my experience modern “PS/2” keyboards do not work reliably though…

To answer your question, yes you can have both the keyboard and the serial port as inputs.

SOLVED: Uptime word and timer initialization

Hello,

The timer_init routine was commented out at line 150 of main.s. After uncommenting and recompiling the ROM, uptime works as expected.

Best wishes, Ben

150 .ifdef timer_init
151     ; bjc uncommented below
152     jsr timer_init
153 .endif

Oops sorry about that, I was probably testing something else and commited that commented line…