Menu

Further problems with a 16F1507

Help
2013-08-13
2013-08-13
  • David Stephenson

    I've updated GCBasic and the chip will now program.
    I am using the 16F1507 as a direct replacement for a 16F887 in a digital clock application.
    The clock part works and drives the LCD display, but the digital inputs on porte for setting the time and changing the display from time to calendar are non-functioning (they work fine if the 16F887 is put back).
    Is there something I am missing here? Any suggestions would be welcome.

     
  • kent_twt4

    kent_twt4 - 2013-08-13

    Literally there is no PortE with the 16F1507. Figuratively speaking, which pins are we talking about?, and are they specified as inputs? Review assembly file and make sure ANSELA, ANSELB, and ANSELC are initialized to zero, and if not, make them so.

     
  • David Stephenson

    I am using pins 8,9 and 10 (re0,re1 and re2) as inputs specified by setting TRISE=b'00000111' . The initialization is shown below so I've added CLRF ANSELC.
    It makes no difference.

    INITSYS
    banksel ADCON0
    bcf ADCON0,ADON
    bcf ADCON1,ADFM
    banksel ANSELA
    clrf ANSELA
    clrf ANSELB
    banksel PORTA
    clrf PORTA
    clrf PORTB
    clrf PORTC
    clrf PORTD
    clrf PORTE
    return

     
  • David Stephenson

    I have also put in clrf ANSELE and now it works.
    Strange the 16F887 did not need this initializing.

     
  • kent_twt4

    kent_twt4 - 2013-08-13

    O.K. so this must be a 16F1517, not the 16F1507 in the topic header. The 16F887 being a more mature product, most of the kinks have been worked out. With the enhanced midrange being relatively newer you might expect to have a few bugs.

    The way Microchip keeps adding peripheral modules, pin multiplexing, and optional pin functions, the more manual manipulation of the registers is required with GCBasic. I think it would be really hard and time consuming to have all the bases covered.

     
    • Chuck Hellebuyck

      This has come up several times now where the ANSEL register wasn't included in the initsys.
      One of the advantages that GCBASIC offers is the beginner doesn't need to set all those registers since the initsys handles it.
      I would hope that a future release could add a couple #if def blocks to add the ANSELD and ANSELE so beginner's don't have to run through this error again.
      I don't see that as a major base to be covered or is that more involved than I realize?

       
      • kent_twt4

        kent_twt4 - 2013-08-13

        Agree that clearing ANSELD, and ANSELE, would be a good addition for the GCBasic initialization routines. Hopefully, Hugh will snag this in a future update for the device families affected.

         
  • David Stephenson

    Yes there are so many different devices I start to confuse the numbers I did mean 16F1517 (well actually it is a 16LF1517).
    I also spent a lot of time mixing up 16F887 and 16F877.

    The other problem that I had is the 16F1517 is not supported in the WINPIC ini files.
    It's a bit tedious writing new .ini files as I really don't know what I am doing.

    I ended up using the program PICPGM which seems to work surprisingly well, and I would recommend it as an updated version of WINPIC.

    The main thing is I've halved the operating current of my clock to about 11 uA.
    The voltage divider for the back planes takes about 3 uA of that.

     
  • kent_twt4

    kent_twt4 - 2013-08-13

    Good job on the current reduction. Going to the newer enhanced midrange devices doesn't always mean less current. The base power specs can be higher than some older versions. Must be extra transistors leaking, or something like that.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.