# IO Board completed and installed; question about uptime word

**URL:** <https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26>\
**Category:** Hardware\
**Created:** [November 15, 2023, 8:20pm UTC](https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26 "2023-11-15T20:20:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![benchapman](https://forum.planck6502.com/user_avatar/forum.planck6502.com/benchapman/32/17_2.png) [@benchapman](https://forum.planck6502.com/u/benchapman)\
**Post date:** [November 15, 2023, 8:20pm UTC](https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26/1 "2023-11-15T20:20:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jonathan](https://forum.planck6502.com/user_avatar/forum.planck6502.com/jonathan/32/10_2.png) [@jonathan](https://forum.planck6502.com/u/jonathan)\
**Post date:** [November 16, 2023, 12:31pm UTC](https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26/2 "2023-11-16T12:31:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![benchapman](https://forum.planck6502.com/user_avatar/forum.planck6502.com/benchapman/32/17_2.png) [@benchapman](https://forum.planck6502.com/u/benchapman)\
**Post date:** [November 16, 2023, 2:18pm UTC](https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26/3 "2023-11-16T14:18:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jonathan](https://forum.planck6502.com/user_avatar/forum.planck6502.com/jonathan/32/10_2.png) [@jonathan](https://forum.planck6502.com/u/jonathan)\
**Post date:** [November 16, 2023, 3:05pm UTC](https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26/4 "2023-11-16T15:05:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![benchapman](https://forum.planck6502.com/user_avatar/forum.planck6502.com/benchapman/32/17_2.png) [@benchapman](https://forum.planck6502.com/u/benchapman)\
**Post date:** [December 2, 2023, 6:54pm UTC](https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26/5 "2023-12-02T18:54:41Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![jonathan](https://forum.planck6502.com/user_avatar/forum.planck6502.com/jonathan/32/10_2.png) [@jonathan](https://forum.planck6502.com/u/jonathan)\
**Post date:** [December 4, 2023, 3:25pm UTC](https://forum.planck6502.com/t/io-board-completed-and-installed-question-about-uptime-word/26/6 "2023-12-04T15:25:47Z")

</div>

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