Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

convert from 16c84 to 16f628a need help

Status
Not open for further replies.
Unfortunately, I'm now tied up until Sunday, so if nobody else has worked out what is going, I will be able to get back to it then.

Jaison - using the working 16F84 PIC you have, can you please give us an a list of what happens from the moment it is turned on.

Then we might be able to work out where in the '628 code it is going wrong.
 
Unfortunately, I'm now tied up until Sunday, so if nobody else has worked out what is going, I will be able to get back to it then.

Jaison - using the working 16F84 PIC you have, can you please give us an a list of what happens from the moment it is turned on.

Then we might be able to work out where in the '628 code it is going wrong.
Good night everyone, Terry turning on the board he is on hold, activating the color (playing to negative) it activates the ptt signal (5 volts) and then releases the beep. If you enter DTMF commands it does other functions.
 
I'm simulating on Proteus, the 16f84 is ok, the 16f628 is in a loop with the ptt activated and with a beep or CW on and off continuously.
 

Attachments

  • Proteus 1.jpg
    Proteus 1.jpg
    273.8 KB · Views: 263
  • Proteus 2.png
    Proteus 2.png
    233.9 KB · Views: 256
Your second image is not the latest code that Terry posted as it doesn't have the BANKSEL code. It looks like the original 84 code.

Actually, that code needs to be changed to,
Code:
ReadEE
        bsf     STATUS,RP0      ;select bank 1
        movwf   EEADR           ;EEADR = w
        bsf     EECON1,RD       ;read EEPROM
        movf    EEDATA,w        ;get EEDATA into w
        bcf     STATUS,RP0      ;select bank 0
        return
I'm guessing that the RP0 code was inserted by Ian and Terry didn't spot it.

Mike.
 
Terry with his last file, the program does not report an error but does not turn on the led or beep when I activate the COR. Previous versions up to 3 stay in the loop, 4 and 5 do not loop but do not turn on the leds in the simulator.
 

Attachments

  • Proteus 4.jpg
    Proteus 4.jpg
    280.1 KB · Views: 253
Terry, that file still has,
Code:
;
; Read EEPROM byte
; address is supplied in W on call, data is returned in w
;
ReadEE
;--------------------------------------------------------------------------------
    BANKSEL    EEADR
;--------------------------------------------------------------------------------
        movwf   EEADR           ;EEADR = w
        bsf     STATUS,RP0      ;select bank 1
        bsf     EECON1,RD       ;read EEPROM
        bcf     STATUS,RP0      ;select bank 0
        movf    EEDATA,w        ;get EEDATA into w
;--------------------------------------------------------------------------------
    BANKSEL    PORTA
;--------------------------------------------------------------------------------
        return
Which is not going to work because EEDATA is in bank 1.

Mike.
Edit, I don't like BANKSEL as it always sets both RP0 and RP1 unnecessarily.
 
I thought I had cleared out the bsf STATUS stuff.

Edit, I don't like BANKSEL as it always sets both RP0 and RP1 unnecessarily.
Does the job as long as you don't stick it after BTFSX and your not squeezed tor space - for me it comes from now using the 16F1827 where there's only one bit to change and saves having to look up the datasheet to find out where everything is.

Try this one Jaison.
 

Attachments

  • rtp2022_628_5.asm
    60.8 KB · Views: 270
Bingo Gentlemen, Terry, Pommie and other colleagues for congratulations. Initial test ok, I will try the commands via DTMF to complete the test.
 
Successfully executed DTMF tests, especially to you Terry and the other colleagues who collaborated with the work, thank you again for all your dedication. May the Great Architect who gave you this intelligence continue to bless you, and may your friends continue to dedicate this intelligence for good, on behalf of all radio amateurs in the southern region of Santa Catarina - Brazil I thank you again and I am available if you need me here . Thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top