Hello Eric,
Thank you very much for your fast reply!
1: I have one question about the calclulation. How is the clock period calculated to 0,5uS with a 8 Mhz crystal?
The PIC divides the frequency of the external crystal by 4, so the 8MHz becomes 2MHZ which has a period of 500nS [ 0.5uS]
2: Where do you set the prescaler to 8 in the program?,,,, see below
Below your code with some comment with my questions. I cannot find this instructions in the manual and I'd like to now the meaning of he instructions.
Best regards,
Reijnko Vast
Define CONF_WORD = 0x3f31 'What's the meaning of this instruction and why this value?
Look at the CONFIGURATION REGISTER in the 16F628A datasheet
AllDigital
This is an Oshonsoft command which sets ADCON so that the PORTA is digital
NOTE: the 628A will initialise to using the Comparators for PORTA, so AllDigital will over-ride
Dim intrcnt As Byte
trisb = 0x00
'adcon1 = 0x84 'can be used for using an analog input??
T1CON = 0x30 '?? sets T1CKPS1 and 0, which sets the pre-scale to 8
T1CON.T1OSCEN = 1 '??
T1CON.TMR1CS = 0 '??
T1CON.TMR1ON = 1 '??
TMR1H = 0x0b 'high byte of countvalue
TMR1L = 0xdc 'low byte of countvalue
INTCON.GIE = 1 '??
INTCON.PEIE = 1 '??
PIE1.TMR1IE = 1 'enable timer 1??
PIR1.TMR1IF = 0 'set countervalue to 0 ??