|
Post by chassar90 on Sept 15, 2010 20:33:22 GMT
Hi Everyone, just built my very first function decoder using the guide. i thought i had a couple of problems at first as the decoder would not respond to address 3. when i programmed it to CV1 = 3 i read it back to make sure it went in and it said CV1 was set to 1. after this i read some more CV's back and they all state 1!! the decoder is now responding to CV1 = 3 but on read back of the CV's they always state 1. Is anyone else experiencing this or is it just me
|
|
|
Post by Paul Harman on Sept 21, 2010 21:45:21 GMT
Which programming mode are you using?
|
|
|
Post by chassar90 on Sept 21, 2010 22:43:05 GMT
Hi
I have tried direct, and also operational mode. My command station is now failing to even try reading the decoders CV's back, and instead of getting 1 back it just says fail. i have tried re-programming the pic with the hex files and still the same thing. other than this the decoder appears to work normally.
Paul
|
|
|
Post by Paul Harman on Sept 22, 2010 15:46:50 GMT
Others have reported problems with reading. Typically it would appear that the page register value is read rather than the CV value. I suspect that a bug has crept in somewhere since I tested reading - I will have to have a look and see which firmware revision caused the problem.
As a workaround you cane read the PIC in the PIC programmer. EEPROM Location 0=page register, location 1=CV1, location 2=CV2 .... Etc.
|
|
suzie
Keen DIYer
Posts: 30
|
Post by suzie on Nov 10, 2012 16:15:27 GMT
I have had a little look at the code an found a couple of problems in the programming area. One affects page mode and the other reading using direct bit mode. All other programming methods look to be OK.
The fix for page mode just involves simplifying the way the page register is written, not quite sure why it was not working in the first place (I was only seeing a problem when reading CV6) but the fix is quite simple, here is the new Set_page code block:-
Set_page ; New method, set CV to CV0 by using value -1 in DATA3 movlw B'11111111' ; -1 in binary, will increment to 0 movwf DATA3 ; Change from 101 (register 6) to page register goto DoCV ; carry on as normal
There is a line in the Test_CV section that needs adjusting too, the incfsz needs to be changed to incf as below or the page register will not write.
;Test_CV:
; Need to make sure that CV is not above 768 or between 256 and 511
movf DATA2,W ; Load top two bits andlw B'00000001' ; Mask off from instruction btfss STATUS,Z ; check that LSB is zero goto exit_bank1 ; CV is above CV256 if non zero movf DATA3,W ; load lowest 8 bits of CV address movwf TEMP incf TEMP,F ; Address 0 is CV1 so increase to get CV and EEPROM number btfsc TEMP,7 ; Valid CV for this decoder is CV1-127 or 513-639
The second fix is for the direct bit mode. The problem here is that when reading the routine goes straight in to the write routine and writes whatever the programmer is trying to verify, corrupting the CV. The answer is to check to see if reading should be happening and jump to the read routine. Just insert these two lines directly after the cv_prog: label:-
cv_prog: ; Check for just verify rather than programming btfss DATA2,3 ; 1=write, 0=verify goto cv_verify ; 0, so verify ; 1 so carry on and write
Combined the fixes result in a reduction of code, so there should be no problem applying this to any custom firmware.
p.s. forgot about this bit, the label is the wrong side of the instruction, so it gets missed when reading.
cv_verify: movf TEMP,W ; CV number held in TEMP
Suzie x
|
|
|
Post by eddy99 on Nov 11, 2012 12:27:36 GMT
Can the Hex file for the function decoder be updated ??
Thanks Eddy
|
|
|
Post by Paul Harman on Nov 12, 2012 0:44:31 GMT
I have updated the .HEX file with Suzie's fixes for function and accessory decoders, and done some testing today. Hopefully the webmaster will get the site updated soon with the new downloads, until then e-mail me and I can send the .HEX files by e-mail in the mean time.
|
|
|
Post by pahare on Nov 27, 2012 16:18:45 GMT
I,ve just edited the V2.18 .asm, compiled it using MPlab V8.56, loaded into a 16F630 via Pickit2... And all working !!!! Brilliant - thanks to all John
Should have added - I used SprogII and DecoderPro for programming and read back. Both direct and paged mode. John
|
|