VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 123456789[10] ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 07:22:53 11/13/01 Tue
Author: Potter
Subject: Re: Which layout of Piu to build?
In reply to: Alcon 's message, "Re: Which layout of Piu to build?" on 09:10:48 11/12/01 Mon

Getting the timing to suit the resonator is very finicky, more than 2 cycles/line out at 50MHz is about as bad as 100 cycles out. I have built 5 Scenix based decoders and got them all to work just fine eventually - just keep at it.
As for programmers, I had major problems with the Steele type and now use the 'Fluffy' in-circuit programmer which always works perfectly (serial mode).
http://www.codepuppies.com/~ben/sens/pic/sx/
Another option is the 'PICer' SX interface. What they have in common is that the timing is controlled by a PIC16F84 and is not dependant on the PC and parallel port type and settings.
To ease the setting up problem I built a variable delay routine into the code which can be changed by pressing a button in real time to get close to the 'magic' MAKEHLINE delay as follows:-
create a couple of register variables delayc, delayx
use a spare input on the SX for the button - I used RB1
in SETMODE add the code to change the delay
btfsc PORTB,1 ; buy button pressed?
goto skipadj ; n - continue
wait 2000 ; wait 40usecs (debounce)
btfsc PORTB,1 ; still pressed?
goto forceul ; n - abort but force re-locking
bcf lockled ;turn off the lock LED
incf delayx,1 ; add 1 to delay counter
relwt wait 2000 ; wait 40 usecs (debounce)
btfss PORTB,1 ; button released?
goto relwt ; n - wait till it is
forceul bcf lockflg ; reset the locked flag
skipadj ;here in 4 cycles if key unpressed
Adjust the delay in SETMODE for the 4 cycles this code uses if no key pressed.
This increments delayx which should be initialised at 1 in MAIN:
movlw 1
movwf delayx ;preset the delay counter
Put the delay routine at the end of MAKEHLINE just before the return instruction
movf delayx,0 ;get current delay value
movwf delayc ;into temp counter
dlyloop decfsz delayc,1 ;decrement counter
goto dlyloop ;until zero
wait 2342 ;wait remainder of line
Set this final delay so that a count of say 5 with a perfect oscillator gives the desired timing
The button connects a 10k resistor from +5V to ground
To use:
Press the button until the lock LED goes off and release - this increments the count by 1 and increases the delay by 4 cycles/line. Keep adjusting until a lock is achieved (probably a coarse lock with lots of jitter) then fine tune by changing the last delay (wait 2342) by 1, compile/burn and do it again until the lock is perfect - an average of 2 burns should get it right.
Finally disable the button checking code by nopping the first btfsc PORTB,1 instruction in SETMODE then hard code the magic count into the counter initialisation instruction in MAIN and compile/burn for the final (good) result.
This saved some hair on my head at least.
A 20MHz version of this may require less cycles/count in the delay routine to be fine enough to get some sort of lock within the range (say 2 or 3). This would be a somewhat longer subroutine but my SX's code space is still less than 50% used so there's plenty of room for anything - say making the delay auto increment if there's no lock for a specified period or number of frames.

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.