1. 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.
    Dismiss Notice

migrating asm code 16C84 to 16C710

Discussion in 'Microcontrollers' started by Brute, Oct 31, 2012.

  1. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Hi all,

    Ive been trying to compile an assembly code written for C84 to C710 but there seem to be some problems. The C710 won't startup as there is no signal on the crystal.
    Can anyone help?

    B.
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,306
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Can you post your assembly file? We can check it...
     
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Why move code from one antique to another antique? (and even an OTP antique), why not use a modern much cheaper (and reprogrammable) device?.

    But as suggested, you need to post your code and what changes you have made to it.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0

    Hi all,

    Well I have a couple of these C710 in stock and I want to make people happy with it. The code is not mine and has already been posted by some guy a while a go. It is the code for a CTCSS tone generator. I've just changed 16C84 into 16C710 and compiled with MPASM for the correct uC.
    Checked all the I/O's and Eprom memory of the C710 and in my oppinion this could not give any problem.
    Thanks,


    B.
     

    Attached Files:

  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,306
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    The only thing you need concern yourself with is the ADCON1. Just clear this reg... Secondly this chip will not hold "tony hunts" name at 0x2100.. just rem it out.
     
  7. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Where do you find ADCON1 of do you mean I have to add it somewhere from line 11?
     
  8. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Like give it value 88h?
     
  9. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    or is it just about bit 0 and 1 from this register PCFG0 and PCFG1 to set for RA2 and MCLR on pin 1 and 4. RA3 and RA4 are not used. How do you add this in asm?
     
  10. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Srry not for MCLR I guess. Just for RA2.
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,306
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    You've been busy....

    banksel ADCON1
    clrf ADCON1

    Done....
     
  12. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Where, after line 11 somewhere or first to begin with? These C710's are hard to re-progam haahah, ruined a few already. How many chance for working instantly?
     
  13. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,306
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Code (text):
        GOTO    START
        ORG 00C8
    START   BSF STATUS,RP0  ;SELECT REG BANK 1
        BSF TRISB,PTT   ;SETUP RB7 AS INPUT FOR PTT
        BCF TRISA,OUT   ;SETUP RA2 AS OUTPUT FOR TONE
        BCF OPTREG,PULLUP   ;SET PULLUP RESISTORS ON PORTB
        MOVLW   0xFF        ; SET PORTB AS I/Ps
        MOVWF   TRISB       ; RB0-RB5 FOR SWITCH INPUTS
        CLRF    ADCON1      ; DISABLE ADC
    In the bank 1 section..
     
  14. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Just that one line? Like this (see attached).
     
  15. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,306
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Yes... just like that.
     
  16. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Hope it will work, the un-modified software did not startup the oscillator on the C710. Will compile tomorrow at work and test later in the afternoon, will let you know, thanks!
     
  17. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,306
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    The code you posted should have still worked.. Even with the A to D's on... If the osc isn't running, then there is something else wrong...
     
  18. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    Strange, I've read there a special routine to startup the oscillator in this C710?
     
  19. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    OST? Oscillator startup timer?
     
  20. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,306
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Its no different to the Power up timer on the latest chips... Its automatic.
     
  21. Brute

    Brute New Member

    Joined:
    Oct 31, 2012
    Messages:
    39
    Likes:
    0
    And I've read that some programmers/experimenters have troubles with programming XT for 4 MHz and do HS for that, could that be the probblem? Is the output on pin 1 digital or just analog? See schematic attached.
     

    Attached Files:

Share This Page