Pira.cz Technical Forum
General Category (This section is not monitored) => Free Topic => Topic started by: Heinz on June 22, 2011, 08:51:07 am
-
Hello there ...
I have built the frequency counter as shown on this website from a Fox-Delta kit (Pre-Scaler MC12080) with the firmware from Jan Kolar. Instead of dividing the frequency by 10 I would like to divide by 20. Has anyone the corresponding Assembly-Code available to do this? As I am not a very experienced programmer your support would be very much appreciated. Thank you.
73 de Heinz, VK4BZT
-
The MC12080 has selectable dividing ratio 10, 20, 40 or 80. Download their datasheet.
-
This has already been done. What I am asking for is the modification of the PIC firmware. The pre-scaler is now dividing by 20 and no longer by 10. After all I need the correct value on the display!
-
This circuit is about 10 years old so I'm afraid you'll not find anybody who can modify the firmware. Moreover simple modification is not possible, it needs to be rewritten completely.
-
Thank you for your comment. I know the counter is a few years old. However, PIC and assembly code are still the same. Why would you want to rewrite the code completly? After all the counter works fine as it is. I thought the person who has written the code is still somewhere out there and would have the answer in a few minutes flat. Software is only as good as it is documented. If you can't see the logic behind the instructions it's rather difficult to modify the code.
73 de Heinz, VK4BZT
-
Dear Sir, it is not clear from your posts what's your wish. The 1 GHz counter is a pretty old circuit based on a /256 divider. You cannot use it with decimal divider (/10, /20 etc.) without complete rewriting the firmware because 256/10 or 256/20 is not an integer. This is a fact that has nothing to do with documentation.
However if you need to correct the value showed by dividing by 2 or multiplying by 2, it can be done simply by changing the prescaler rate of the PIC. It seems you know programming very well so it should be a simple task for you. Change the line
MOVLW B'01110011' ;prescaler & pull-ups
to
MOVLW B'01110010' ;prescaler & pull-ups
or
MOVLW B'01110100' ;prescaler & pull-ups
and compile the asm file again (for example using MPASMWIN).
Alternatively you may change the crystal value in the ratio required (but this may be increased only due to display refresh rate).
-
Dear Jan.
This is exactly the information I was after. I shall re-program the PIC in the next couple of days. I have to up-date the PICkit2 software as well. No, I'm not that experienced as yet. May be in due course? Many, many thanks for your assistance. Great ham spirit!
vy 73 de Heinz, VK4BZT
-
Dear Jan
After some initial euphoria I must admit things are not as simple as changing the pre-scaler rate only. The changes are much more involved. As you indicated earlier a large junk of the code would have to be rewritten. This is a bit beyond my abilities. Anyway many thanks again for your comments.
73s de Heinz, VK4BZT
-
dear juan
i am going to make the frequency counter but i have some dificulties on components side i need some help
i cant find the prescaler and no other equivalent that scale by 256 ,can i use prescaler u664b that scale by 64 and changing the xtal value from 4 to 16 mhz do that work.another thing can i use pic16lf84 because also cant find 16f84a.thanks
-
I don't see any problem! 8)
For connection to the PIC you may use this picture http://www.datasheetarchive.com/dl/Datasheets-34/DSA-678559.pdf
Don't forget the PIC OSC must be set to HS in fuses. I think that the 16F84 has a maximum frequency of 10 MHz (the 16F84A has 20 MHz) but overclocking is possible. Let us know how it works...
-
ok sir when its finished i will upload the final project to the gallery .but i need exact response is it the same that if i up the xtal frequency from 4 to 16 and down the scale from 256 to 64 will this remain the same in work .yess or no .plz exact response .Thanks JAN for help
-
It will work the same way with one exception - the display refresh rate will be 4 times higher but this makes no problem.
-
Thanks u are the man when it finished i will send final to u thanks for pira .i want to buy and this for my hobbie the audio spectrum analyser and one minirds but have some problem with the shippement hi price but its not a problem when my money will be enough :) i will surely buy them.1000 THANKS.
-
:D :DDEAR JAN from my first result on the function of the 1 GHZ counter it seems to work perfect when i have put u664b scale by 64 and keeping the xtal firstly 4MHZ i have to divide the result by 4
exemple :exciter maun frequency 98.3 i saw on the led display of the freqquency counter 393.2 mhz /4=98.3.
changing the xtal to 8.00MHZ i have on the display 196.6 (196.6/2)=98.3 mhz .
the bad news that i cant get the xtal 16MHZ oscllate ,i have increased the value of the parralel capacitors from 22pf to 33pf and decreasing them to 15pf but nothing happened .i guet on yhe display NUMBER (P)
thanks for help.
-
As I mentioned above, if you use PIC16F84-04/P, it has a maximum frequency of 4 MHz so it will probably not work on 16 MHz. Make sure you've selected HS oscillator mode. If no succes, you must buy PIC16F84A-20/P.
It is also possible to use 4 MHz crystal and change the prescaller value in the asm file as showed below and compile it again:
Original value:
MOVLW B'01110011' ;prescaler & pull-ups
New value:
MOVLW B'01110101' ;prescaler & pull-ups
-
JAN i use pic16LF84A.
-
I know only 16LF84A-04 or 16LF84A-20
-
Jan mine that i use is 16LF84A-04P will that work work 16MHZ quartz ?because i have an RDS encoder that use 16F84A with 16MHZ quartz .IF yes what do i have to do maybe re-burnig the HEX code .Thanks for explain. :-\
-
Low power PIC with maximum frequency of 4 MHZ will surely not work on 16 MHz. The -04 in the mcu name means max. 4 MHz.
-
JAN i use same pic16lf84a i have changed the oscillator hex value to HS with xtal 16mhz and prescaler U664B .THANKS
-
please how can i pm u JAN i do that 3 times with no response please help i want to pm u with photos and some expications on what i want to do
-
Can you help me ,i built this wonderful unit counter in 2011 ,and i want today to delay the screen when it show pira for 5 seconds and reanme it to RD98 is it possible in the asm file and how thanks