> My questions are basically;

> *Would pulsin be the best thing to use?

Not really although you could. Pulsin returns the PERIOD of the pulse (ie it's duration), it does not tell you how many Pulses you're going receive in any given time period. If you're going to measure a High Pulse and a Low Pulse, sum them together, you can then 'guesstimate' that your running at 'x' Hertz, but really it will be no better than a guess.

It would be better to COUNT, but since PBC hasn't got that feature (at least it hasn't in my manual), it would be more sensible to start a Clock (ie TMR1) and Count the number of pulses that are received in say 100mS.

> *Are variables just refered to as B0, W1 etc? (using 'Symbol' to name them)

Not having PBC, then again according to the manual it looks like you've only got variable B0-Bx (as Bytes), and W0-Wx (as Words). You can rename them to whatever is convenient, and I would certainly recommend you do so... example...

Symbol TachoCount = B0

See 2.8.2 in the PBC manual.

> *What happens if a number is too big to fit into a variable? Will the number overflow into the next var, or will only the left hand side be stored?

It'll roll thrugh zero and start counting all over again (ie only the relevant significant digits - be they eight or sixteen - are stored)...

eg (for a Byte)..

$FD, $FE, $FF, $00, $01, $02 etc..

or if it's a Word...

$FFFD, $FFFE, $FFFF, $0000, $0001, $0002 etc

There is no flag or other indication to say it's done so... but a bit of math will tell you if you've blown the limit...

B2=B0+B1
If B2 < B0 then goto Overflow

If you're adding two numbers together, the the sum must be 'equal to' or 'more than' that what you started with... if it's 'less than', then you've overflowed.

Melanie

PS. eBay purchases are a little tricky as I don't think you've got a supported upgrade path according to MeLabs unless the seller is an authorised Distributor.