[Oberon] PO2013 - Real time measurement

Paul Reed paulreed at paddedcell.com
Fri Apr 19 17:51:25 CEST 2019


> Here is my `DIY toy board', `RC' to the right of PIC is a dummy, as
> `p16f818' has its own internal osc block (unlike `p16f84a' that needs
> ext. RC or XTAL), so are two switches, need to think how to read an
> input.

Neat!  [sunglasses emoji] ;-)

(In your configuration in the hex you published, I thought you *were* 
using the external RC.)


> I wonder if I could wire switches direct or some pull/ups/downs...

You can enable weak pull-ups on PORTB in software, see the datasheet [1] 
sec. 5.2.

I assume you still have the LEDs on bits 3..0, it looks like that may be 
the case from the picture, I assume you are doing some sneaky wiring 
underneath the board.  ;-)

(Curious about the resistor already on RA4, BTW.)

So you could wire the pushbuttons across to pins 13 and 12 (RB7..RB6), 
which wouldn't interfere with the SPI port or with in-circuit 
programming, assuming you would wire the other side of each pushbutton 
to ground.

You may want external components though, depending on your exact 
intended de-bounce method.

In PICL, the statement

   ?~B.7

will loop until (the first time) bit 7 of PORTB goes low.  See section 5 
of [2].

Cheers,
Paul

[1] PIC16F818/819 datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/39598F.pdf
[2] Wirth: "PICL: A Programming Language for the Microcontroller PIC".
https://people.inf.ethz.ch/wirth/PICL/PICL.pdf


More information about the Oberon mailing list