[time-nuts] Pictic II mods

Richard H McCorkle mccorkle at ptialaska.net
Sat Jul 3 00:15:00 UTC 2010


Bob,
Another option with the 16F688 is to "tweak" the internal oscillator
rate slightly to give the proper baud rate. The code includes the
following two lines (normally commented out) to do this.

;	movlw	0x00	;put the cal value in OSCTUNE
;	movwf 	OSCTUNE 	;to calibrate oscillator

>From the Spec Sheet:

The HFINTOSC is factory calibrated but can be adjusted in software
by writing to the OSCTUNE register. The default value of the OSCTUNE
register is ‘0’. The value is a 5-bit two’s complement number. When
the OSCTUNE register is modified, the HFINTOSC frequency will begin
shifting to the new frequency. Code execution continues during this
shift.

bit 4-0 TUN<4:0>: Frequency Tuning bits

01111 = Maximum frequency
00001 = Increasing Frequency
00000 = Oscillator module is running at the calibrated frequency.
11111 = Decreasing Frequency
10000 = Minimum frequency

Richard


> Hi
>
> Yup, and as you go to higher baud rates the +/- one makes for a bigger "hop" in the
> baud rate.
>
> One cute way to attack the problem:
>
> Set the baud rate so it *should* be fast
> Set the PIC transmitter to send two stop bits (or marking parity and two stop bits
> if you can).
> Set the PC receiver to look for one stop bit and no parity.
>
> Net result is that you can tolerate a much higher baud rate error in a "transmit
> mostly" application like this one.
>
> Bob
>
>
> On Jul 2, 2010, at 5:44 PM, Stanley Reynolds wrote:
>
>> yes, internal clock, may need to tune the osc or try +- one number, external osc
>> pins are in use.
>>
>> Stanley
>>
>>
>>
>> ----- Original Message ----
>> From: Bob Camp <lists at rtty.us>
>> To: Discussion of precise time and frequency measurement <time-nuts at febo.com>
>> Sent: Fri, July 2, 2010 4:11:11 PM
>> Subject: Re: [time-nuts] Pictic II mods
>>
>> Hi
>>
>> I believe he's using the internal clock on the PIC. It's not super accurate,
>> so running a lot of data can be an issue.
>>
>> Bob
>>
>> -----Original Message-----
>> From: time-nuts-bounces at febo.com [mailto:time-nuts-bounces at febo.com] On
>> Behalf Of Stanley Reynolds
>> Sent: Friday, July 02, 2010 3:41 PM
>> To: time-nuts at febo.com
>> Subject: [time-nuts] Pictic II mods
>>
>> Looking at Richard's code in PICTICII.ASM :
>>
>>    bsf     TXSTA,BRGH            ;set USART hi speed mode
>>    movlw D'51'                         ;set async rate at 9600 baud (51. for
>> 8
>> MHz int, BRGH=1)
>>    movwf SPBRG
>>
>> Then '25' would be 19,200 baud
>> and '12' would be 38,400 baud
>>
>> Need to test this but could be a way to get more data out.
>>
>> Stanley
>>
>> _______________________________________________
>> time-nuts mailing list -- time-nuts at febo.com
>> To unsubscribe, go to
>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>> and follow the instructions there.
>>
>>
>>
>>
>> _______________________________________________
>> time-nuts mailing list -- time-nuts at febo.com
>> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>> and follow the instructions there.
>>
>>
>> _______________________________________________
>> time-nuts mailing list -- time-nuts at febo.com
>> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>> and follow the instructions there.
>>
>
>
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>






More information about the Time-nuts_lists.febo.com mailing list