I obviously don't understand how the COUNT instruction works. The PBP manual says "The resolution of Period is in milliseconds. It tracks the oscillator
frequency based on the DEFINEd OSC." In the program below, the period is 1000msec., or 1 second. When I apply a 66 hz. squarewave to RC5, I the LCD says 66. When I change the period to 2000, it says 33. Shouldn't it say 132? Also, if I change the period to 500, the LCD says 33. I don't get it.

;****16F946:

Pause 10 ;for ICSP
@ __config _WDT_OFF & _CP_OFF & _PWRTE_ON & _MCLRE_ON & _INTRC_OSC_NOCLKOUT

OPTION_REG = %11000000 ;pullups disabled, rising edge, no prescale
ANSEL = 0 ;all pins digital
CMCON0 = 7 ;comparators off
ADCON0 = 0 ;ADC's off
WDTCON = 0 ;WDT off

TRISA = %00000000
TRISB = %11000001 ;switches on RB6,RB7, INT on RB0
TRISC = %00000000 ;LED on RC5, LCD bias on RC3
TRISD = %00000000
TRISE = %00001000 ;MCLR on RE3
TRISF = %00000000
TRISG = %000000

OSCCON = %01100001 ;4mz. mhz. internal

LCD_DB4 VAR PORTB.1
LCD_DB5 VAR PORTB.2
LCD_DB6 VAR PORTA.7
LCD_DB7 VAR PORTA.6
LCD_RS VAR PORTB.3
LCD_E VAR PORTD.2
LCD_Lines CON 1 ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines)
LCD_DATAUS CON 2 ' Data delay time in us
LCD_COMMANDUS CON 20 ' Command delay time in us

INCLUDE "LCD_AnyPin.pbp" ; *** Include MUST be AFTER LCD Pin assignments ****

define OSC 4

W1 var WORD
X1 var word
X1 = 0

PORTC.4 = 0 ;leds off
PORTD.3 = 0

Main:

count PORTC.5, 1000, W1
lcdout $fe,1, dec W1
pause 10
goto Main

Any help will be greatly appreciated.