Yesterday 20:36
Forum: Proton Plus Compiler v3
Starter: Henk57
Views: 0
Replies: 8
Yesterday 19:26
Forum: Absolute Beginners Section
Starter: amod
Views: 0
Replies: 22
Yesterday 16:05
Forum: New devices and techniques
Starter: normnet
Views: 0
Replies: 26
Yesterday 10:51
Forum: Proton 24
Starter: nhadzid
Views: 0
Replies: 0
+ Reply to Thread
Results 1 to 8 of 8

Thread: 16f72029 days old

  1. #1
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    160
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    876.71 MB

    0 Not allowed!

    Default 16f720

    HELLO
    The 16F720 is driving me nuts, I had SOIC version and could not get them to run at all so I bought a couple of Dips (all from Digikey) and it is like the program counter never starts, I can get the /4 clock out of Porta.4 so I know the clock is working and I checked a read of the Config and it is ok, The ports are OK as the primary SFR can turn them off and on. I loaded from Both MPLAB 8 and 10, i even ran a occ into the clockin, nothing? have anybody had this problem.
    Many thanks
    Gary

    Device = 16F720

    Declare Xtal = 3

    Declare Reminders Off
    @ CONFIG_REQ = 0 ; Override Compiler's configuration settings
    asm-
    __Config _Config1, 0x2CD5 ;FOSC_INTOSCCLK & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & CP_OFF & BOREN_OFF & PLLEN_OFF
    __Config _Config2, 0x3FFF ;WRTEN_OFF
    endasm-
    Declare Reminders On

    TRISA = 000000
    PORTA = 000000
    TRISB = 000000
    PORTB = 000000
    TRISC = 000000
    PORTC = 000000
    ANSELA = 000000
    ANSELB = 000000
    ANSELC = 000000
    OSCCON = 110000
    ADCON0 = 000000
    T1CON = 000000
    T2CON = 000000
    IOCA = 000000
    IOCB = 000000
    ADCON0 = 000000

    CLEAR

    DELAYMS 20



    RUNIT:

    HIGH PORTC.0
    DELAYMS 20
    LOW PORTC.0
    DELAYMS 20

    HIGH PORTC.1
    DELAYMS 20
    LOW PORTC.1
    DELAYMS 20

    HIGH PORTC.2
    DELAYMS 20
    LOW PORTC.2
    DELAYMS 20

    GOTO RUNIT
    Last edited by Oldhack; 25th May 2018 at 03:33. Reason: Shorten

  2. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,620
    Thumbs Up
    Received: 103
    Given: 146
    Total Downloaded
    2.75 GB

    0 Not allowed!

    Default Re: 16f720

    not necessarily your answer but I set all gpio to input unless reqired to be output.
    George

  3. #3
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    305
    Thumbs Up
    Received: 23
    Given: 30
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: 16f720

    Gary, I run in trouble in the past with Port.E who had 4 I/O lines.
    From that day I do always like this;

    Code:
    TRISA = %000000
    PORTA = %000000
    TRISE = %0000
    PORTE = %0000
    Just a remark why do you select Xtal 3 instead of 4?

    Henk.

  4. #4
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    160
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    876.71 MB

    0 Not allowed!

    Default Re: 16f720

    Hello
    I have never had a 16F chip not at least do something, this chip will not do any code at all, I even tried assembly,
    I used every trick in the book, I tried the short tris & port Henk (I will keep this in my box of tricks for future) that did not work, I think this may be a Pickit or a Microchip problem. but to show up on a SOIC and a DIP ordered 3 weeks apart from Digikey??? it may require tossing the tube in the Bin.
    I did not want to desolder the SOIC chips off there board I am glad I only did two.
    I uses the Config 3 so I could see if the Occ was working by looking at the A.4 pin /4 clock out, I tried all four configs for clock and speed also Checked the Config from a chip read and it was OK , I will have to move on as I ordered some other SOIC chips to finish the projects.
    I will now have to get a hair transplant as I have pulled it all out in the last two days.
    I am one of those people that hate to fail, (Note I have bins full of failed projects eek).

    Gary

  5. #5
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    305
    Thumbs Up
    Received: 23
    Given: 30
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: 16f720

    Sorry to hear.

    When I moved to 16F1829 for the first time it was an relaxed study in all quit, with coffee, and the first test program works fine.
    How hard can it be with the 720!

    If it is possible think over again and move to another chip.
    If you do, I can advise for 1825/1829, take briefly note in the pdf file from Microchip.

    Henk.
    Last edited by Henk57; 25th May 2018 at 15:33.

  6. #6
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    160
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    876.71 MB

    0 Not allowed!

    Default Re: 16f720

    Hello
    I am going to try 16F1707, used the 16F18xx chips and they work well only a few problems with failing to read the fine print.

    Thanks
    Gary

  7. #7
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    407
    Thumbs Up
    Received: 24
    Given: 3
    Total Downloaded
    1.51 GB

    0 Not allowed!

    Default Re: 16f720

    Strange problem, it is almost as if the MCRL is stuck in the clear and not allowing the code to run, although that would seem unlikely.
    One thing I do know that will stop perfectly good code running is setting the oscillator to a type that not correct for the clock source/frequency. I noticed that you have the XTAL set to 3MHz when that is not an option even with the PLL enabled. If I have read it correctly your current setup appears to have the oscillator running at 500KHz when declared to the compiler as being 3MHz, it is possible that may be messing thing up.
    Try changing XTAL to 2, OSCON to $00 and enabling the PLL and see if it work then at 2MHz.

    I also noticed you have set ADCON0 twice, I think the second one was meant to be ADCON1.

  8. #8
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    160
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    876.71 MB

    0 Not allowed!

    Default Re: 16f720

    Hello
    I ran many clock frequencies, and built up separate programs, on a PCB and then a proto board,ordered new chips, two days of fiddling, I changed all the Config around and SFRs, any thing I could think of to do I did.
    Then I stuck a 16F1707 on the board, changed the config and a couple of SFRs and Bingo it worked fine with the 16F1707????.
    I have programmed at least thirty or so different PICs the last couple of years and never had a problem with starting up the chip.
    I at some time will reload all the Microchip drivers Etc. and see what happens.
    The thing is the Oscillator is working on the chip I even fed it with a clockb in the clock input mode it has to be a Microchip glitch.

    Many thanks
    Moral of the story is to use the chips that worked well in te past, even if you can save a few cents each.
    Gary

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Members who have read this thread since 5th June 2018, 22:28 : 0

Actions :  (Set Date)  (Clear Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts