A header wizard


Closed Thread
Results 1 to 40 of 230

Thread: A header wizard

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    1st praise - excellent so far
    2nd requests
    - instead of just giving me an error when mpasm cant be found, can it bring up a file dialog to find it?
    - can we have a browse button to get the path to mpasm?
    - after setting the path, reload to populate. (now it requires exit and restart)
    - request or bug, depends on you. can't type a part number in direct. error right away. (file not found)

    3rd bugs
    - so far all I see is tris sets the port, and initial state sets tris. port g on 16f1947 tris and portl are correct. only 5 pins for G, maybe thats it?
    - tried it with a 16f676, device has 12 I/O a0..5 and c0..5 wizard configures for 8 and 8. gets the names correct.
    - initially on startup, "select device" text is not there. if I max the window, its there.


    Overall awesome! Looking forward to more!
    Last edited by cncmachineguy; - 14th September 2010 at 06:02.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    PROBLEM...

    I thought the MPASM *.inc file had all of the info we needed for this but now it looks like I am wrong.

    I can not find where the ports are defined.
    Where does it tell that the 16F676 only has six pins on a port?

    Evidently the data sheet is the only place to find the info.
    HIGH PORTC.7
    compiles just fine for a 16F676.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Maybe it's not so much a problem as a limitation. If the info is not available in the .inc, that's just one of the things the programmer will still have to rtfd for. The only other choice would be to build in an editor and custom make a new .inc so to speak.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Peter, Great Job! Very nice. Thanks for putting it together!

    Quote Originally Posted by mackrackit View Post
    PROBLEM...

    I thought the MPASM *.inc file had all of the info we needed for this but now it looks like I am wrong.
    Me too!

    It looks like this information is stored in mplab ide. Its a little harder to read though.

    It is located here: C:\Program Files\Microchip\MPLAB IDE\Device

    In my search, I came across a video presentation of Microchips Visual Device Initiator. Sad to say, I am drooling at the 2004 technology. Fast forward to about 11 minutes in or so. It is kind of like a config wizard, and PicMultiCalc all in one. http://techtrain.microchip.com/media/websem/VDI_082604.wmv or check out http://www.scalerobotics.com/VDI Tutorial.pdf

    Code:
    ######################################################################
    #
    # MPLAB IDE .dev File Generated by `pic2dev.py'
    #
    # Device: PIC16F676
    # Family: 16xxxx
    # Datasheet: 40039
    # Date: Mon Apr  5 06:55:05 2010
    #
    ######################################################################
    
    
    ######################################################################
    #
    # Memory Regions & Other General Device Information
    #
    ######################################################################
    
    vpp (range=12.750-13.250 dflt=13.000)
    vdd (range=2.500-5.500 dfltrange=3.000-5.500 nominal=5.000)
    pgming (memtech=ee tries=1 lvpthresh=4.500)
        wait (pgm=2000 eedata=6000 cfg=2500 userid=2500 erase=6000 lvpgm=2500)
        latches (pgm=1 eedata=1 cfg=1 userid=1)
    EraseAlg=4
    UndefCfgBits=0
    breakpoints (numhwbp=1 datacapture=false idbyte=x)
    calmem (region=0x3ff-0x3ff)
    userid (region=0x2000-0x2003)
    testmem (region=0x2000-0x20ff)
    devid (region=0x2006-0x2006 idmask=0x3fe0 id=0x10e0)
    cfgmem (region=0x2007-0x2007)
    eedata (region=0x0-0x7f)
    bkbgvectmem (region=0x2004-0x2004)
    pgmmem (region=0x0-0x3ff)
    NumBanks=2
    MirrorRegs (0xa-0xb 0x8a-0x8b)
    MirrorRegs (0x2-0x4 0x82-0x84)
    MirrorRegs (0x0-0x0 0x80-0x80)
    MirrorRegs (0x20-0x5f 0xa0-0xdf)
    UnusedRegs (0x60-0x7f)
    UnusedRegs (0xe0-0xff)
    
    ######################################################################
    #
    # Special Function Registers
    #
    ######################################################################
    
    sfr (key=INDF addr=0x0 size=1 flags=i access='u u u u u u u u')
        reset (por='--------' mclr='--------')
        bit (names='INDF' width='8')
    sfr (key=TMR0 addr=0x1 size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='xxxxxxxx' mclr='uuuuuuuu')
        bit (names='TMR0' width='8')
        stimulus (scl=rwb pcfiles=w regfiles=w type=int)
    sfr (key=PCL addr=0x2 size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='00000000' mclr='00000000')
        bit (names='PCL' width='8')
        stimulus (scl=rwb pcfiles=rw regfiles=w)
    sfr (key=STATUS addr=0x3 size=1 access='r r rw r r rw rw rw')
        reset (por='00011xxx' mclr='000qquuu')
        bit (names='IRP RP nTO nPD Z DC C' width='1 2 1 1 1 1 1')
    sfr (key=FSR addr=0x4 size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='xxxxxxxx' mclr='uuuuuuuu')
        bit (names='FSR' width='8')
        stimulus (scl=rwb pcfiles=rw regfiles=w type=int)
    sfr (key=PORTA addr=0x5 size=1 access='u u rw rw rw rw rw rw')
        reset (por='--xxxxxx' mclr='--uuuuuu')
        bit (names='- - RA5 RA4 RA3 RA2 RA1 RA0' width='1 1 1 1 1 1 1 1')
        bit (tag=scl names='RA' width='8')
        stimulus (scl=rwb pcfiles=rw regfiles=rw)
    UnusedRegs (0x6-0x6)
    sfr (key=PORTC addr=0x7 size=1 access='u u rw rw rw rw rw rw')
        reset (por='--xxxxxx' mclr='--uuuuuu')
        bit (names='- - RC5 RC4 RC3 RC2 RC1 RC0' width='1 1 1 1 1 1 1 1')
        bit (tag=scl names='RC' width='8')
        stimulus (scl=rwb pcfiles=rw regfiles=rw)
    UnusedRegs (0x8-0x9)
    sfr (key=PCLATH addr=0xa size=1 access='u u u rw rw rw rw rw')
        reset (por='---00000' mclr='---00000')
        bit (names='- - - PCLATH' width='1 1 1 5')
        stimulus (scl=rwb pcfiles=rw regfiles=w type=int)
    sfr (key=INTCON addr=0xb size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='00000000' mclr='0000000u')
        bit (names='GIE PEIE TMR0IE INTE RAIE TMR0IF INTF RAIF' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb pcfiles=rw regfiles=w)
    sfr (key=PIR1 addr=0xc size=1 access='rw rw u u rw u u rw')
        reset (por='00--0--0' mclr='00--0--0')
        bit (names='EEIF ADIF - - CMIF - - TMR1IF' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb pcfiles=rw regfiles=w)
    UnusedRegs (0xd-0xd)
    sfr (key=TMR1 addr=0xe size=2 flags=j)
        bit (names='TMR1' width='16')
        stimulus (scl=rwb regfiles=w type=int)
    sfr (key=TMR1L addr=0xe size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='xxxxxxxx' mclr='uuuuuuuu')
        bit (names='TMR1L' width='8')
        stimulus (scl=rwb pcfiles=w regfiles=w type=int)
    sfr (key=TMR1H addr=0xf size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='xxxxxxxx' mclr='uuuuuuuu')
        bit (names='TMR1H' width='8')
        stimulus (scl=rwb pcfiles=w regfiles=w type=int)
    sfr (key=T1CON addr=0x10 size=1 access='u rw rw rw rw rw rw rw')
        reset (por='-0000000' mclr='-uuuuuuu')
        bit (names='- TMR1GE T1CKPS T1OSCEN nT1SYNC TMR1CS TMR1ON' width='1 1 2 1 1 1 1')
        stimulus (scl=rwb regfiles=w)
    UnusedRegs (0x11-0x18)
    sfr (key=CMCON addr=0x19 size=1 access='u r u rw rw rw rw rw')
        reset (por='-0-00000' mclr='-0-00000')
        bit (names='- COUT - CINV CIS CM' width='1 1 1 1 1 3')
        stimulus (scl=rwb regfiles=w)
    UnusedRegs (0x1a-0x1d)
    sfr (key=ADRESH addr=0x1e size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='xxxxxxxx' mclr='uuuuuuuu')
        bit (names='ADRESH' width='8')
        stimulus (scl=rwb type=int)
    sfr (key=ADCON0 addr=0x1f size=1 access='rw rw u rw rw rw rw rw')
        reset (por='00-00000' mclr='00-00000')
        bit (names='ADFM VCFG - CHS GO/nDONE ADON' width='1 1 1 3 1 1')
        bit (tag=scl names='ADFM VCFG - CHS GO_nDONE ADON' width='1 1 1 3 1 1')
        stimulus (scl=rwb regfiles=w)
    sfr (key=OPTION_REG addr=0x81 size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='11111111' mclr='11111111')
        bit (names='nRAPU INTEDG T0CS T0SE PSA PS' width='1 1 1 1 1 3')
        stimulus (scl=rwb regfiles=w)
    sfr (key=TRISA addr=0x85 size=1 access='u u rw rw r rw rw rw')
        reset (por='--111111' mclr='--111111')
        bit (names='- - TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0' width='1 1 1 1 1 1 1 1')
        bit (tag=scl names='TRISA' width='8')
        stimulus (scl=rwb regfiles=w)
    UnusedRegs (0x86-0x86)
    sfr (key=TRISC addr=0x87 size=1 access='u u rw rw rw rw rw rw')
        reset (por='--111111' mclr='--111111')
        bit (names='- - TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0' width='1 1 1 1 1 1 1 1')
        bit (tag=scl names='TRISC' width='8')
        stimulus (scl=rwb regfiles=w)
    UnusedRegs (0x88-0x89)
    sfr (key=PIE1 addr=0x8c size=1 access='rw rw u u rw u u rw')
        reset (por='00--0--0' mclr='00--0--0')
        bit (names='EEIE ADIE - - CMIE - - TMR1IE' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb pcfiles=rw regfiles=w)
    UnusedRegs (0x8d-0x8d)
    sfr (key=PCON addr=0x8e size=1 access='u u u u u u rw rw')
        reset (por='------0x' mclr='------uu')
        bit (names='- - - - - - nPOR nBOR' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb regfiles=w)
    UnusedRegs (0x8f-0x8f)
    sfr (key=OSCCAL addr=0x90 size=1 access='rw rw rw rw rw rw u u')
        reset (por='100000--' mclr='100000--')
        bit (names='CAL - -' width='6 1 1')
        stimulus (scl=rwb regfiles=w)
    sfr (key=ANSEL addr=0x91 size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='11111111' mclr='11111111')
        bit (names='ANS7 ANS6 ANS5 ANS4 ANS3 ANS2 ANS1 ANS0' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb regfiles=r)
    UnusedRegs (0x92-0x94)
    sfr (key=WPUA addr=0x95 size=1 access='u u rw rw u rw rw rw')
        reset (por='--11-111' mclr='--11-111')
        bit (names='- - WPUA5 WPUA4 - WPUA2 WPUA1 WPUA0' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb regfiles=w)
    sfr (key=IOCA addr=0x96 size=1 access='u u rw rw rw rw rw rw')
        reset (por='--000000' mclr='--000000')
        bit (names='- - IOCA5 IOCA4 IOCA3 IOCA2 IOCA1 IOCA0' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb regfiles=w)
    UnusedRegs (0x97-0x98)
    sfr (key=VRCON addr=0x99 size=1 access='rw u rw u rw rw rw rw')
        reset (por='0-0-0000' mclr='0-0-0000')
        bit (names='VREN - VRR - VR' width='1 1 1 1 4')
        stimulus (scl=rwb regfiles=w)
    sfr (key=EEDAT addr=0x9a size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='00000000' mclr='00000000')
        bit (names='EEDAT' width='8')
        stimulus (scl=rwb pcfiles=rw regfiles=rw)
    sfr (key=EEADR addr=0x9b size=1 access='u rw rw rw rw rw rw rw')
        reset (por='-0000000' mclr='-0000000')
        bit (names='- EEADR' width='1 7')
        stimulus (scl=rwb pcfiles=rw regfiles=w)
    sfr (key=EECON1 addr=0x9c size=1 access='u u u u rw rw rs rs')
        reset (por='----x000' mclr='----q000')
        bit (names='- - - - WRERR WREN WR RD' width='1 1 1 1 1 1 1 1')
        stimulus (scl=rwb pcfiles=rw regfiles=w)
    sfr (key=EECON2 addr=0x9d size=1 access='w w w w w w w w')
        reset (por='--------' mclr='--------')
        bit (names='EECON2' width='8')
    sfr (key=ADRESL addr=0x9e size=1 access='rw rw rw rw rw rw rw rw')
        reset (por='xxxxxxxx' mclr='uuuuuuuu')
        bit (names='ADRESL' width='8')
        stimulus (scl=rwb regfiles=r type=int)
    sfr (key=ADCON1 addr=0x9f size=1 access='u rw rw rw u u u u')
        reset (por='-000----' mclr='-000----')
        bit (names='- ADCS - - - -' width='1 3 1 1 1 1')
        stimulus (scl=rwb regfiles=w)
    
    ######################################################################
    #
    # Configuration Registers
    #
    ######################################################################
    
    cfgbits (key=CONFIG addr=0x2007 unused=0xe00)
        illegal (mask=0x48 value=0x48 msg="Current settings of PWRT and BOD are in conflict")
        field (key=OSC mask=0x7 desc="Oscillator")
            setting (req=0x7 value=0x7 desc="External RC Clockout")
            setting (req=0x7 value=0x6 desc="External RC No Clock")
            setting (req=0x7 value=0x5 desc="Internal RC Clockout")
            setting (req=0x7 value=0x4 desc="Internal RC No Clock")
            setting (req=0x7 value=0x3 desc="EC")
            setting (req=0x7 value=0x2 desc="HS")
            setting (req=0x7 value=0x1 desc="XT")
            setting (req=0x7 value=0x0 desc="LP")
        field (key=WDT mask=0x8 desc="Watchdog Timer")
            setting (req=0x8 value=0x8 desc="On")
            setting (req=0x8 value=0x0 desc="Off")
        field (key=PUT mask=0x10 desc="Power Up Timer")
            setting (req=0x10 value=0x10 desc="Off")
            setting (req=0x10 value=0x0 desc="On")
        field (key=MCLRE mask=0x20 desc="Master Clear Enable")
            setting (req=0x20 value=0x20 desc="External")
            setting (req=0x20 value=0x0 desc="Internal")
        field (key=BODEN mask=0x40 desc="Brown Out Detect")
            setting (req=0x40 value=0x40 desc="On")
            setting (req=0x40 value=0x0 desc="Off")
        field (key=CP mask=0x80 desc="Code Protect")
            setting (req=0x80 value=0x80 desc="Off")
                checksum (type=0x0 protregion=0x0-0x0)
            setting (req=0x80 value=0x0 desc="On")
                checksum (type=0x20 protregion=0x0-0x3fe)
        field (key=CPD mask=0x100 desc="Data EE Read Protect")
            setting (req=0x100 value=0x100 desc="Off")
            setting (req=0x100 value=0x0 desc="On")
        field (key=BG mask=0x3000 desc="Bandgap Calibration Bits" flags=xh)
            setting (req=0x3000 value=0x3000 desc="Adjust Bandgap Voltage (-100mV)")
            setting (req=0x3000 value=0x1000 desc="Target Bandgap Voltage (2.1V)")
            setting (req=0x3000 value=0x0 desc="Adjust Bandgap Voltage (100mv)")
    Last edited by ScaleRobotics; - 14th September 2010 at 15:55.
    http://www.scalerobotics.com

  5. #5
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    PROBLEM...

    I thought the MPASM *.inc file had all of the info we needed for this but now it looks like I am wrong.

    I can not find where the ports are defined.
    Where does it tell that the 16F676 only has six pins on a port?

    Evidently the data sheet is the only place to find the info.
    HIGH PORTC.7
    compiles just fine for a 16F676.
    Hi Dave,

    It fooled me too. I've now been through ALL of the files (PBP, MPASM, and Proton) and see no way to glean the individual port bits that don't exist. So I've found the right spot in the code to toss in exceptions to the general rules. Now, if the part name is "16F676" or "16F630", it will show only PORTA and PORTC with bits 0-5 enabled. As additional problem children are identified I can keep adding the special handling for them there.

    I'll have a new version posted sometime today.

    With regard to the ADC settings, I remain woefully short in the imagination department. Could someone please post what items you would like to select for setting up the ADC, then show me an example of what the output should look like? That would be a big help...

    Best Regards,
    Paul

  6. #6
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    1st praise - excellent so far
    2nd requests
    - instead of just giving me an error when mpasm cant be found, can it bring up a file dialog to find it?
    - can we have a browse button to get the path to mpasm?
    - after setting the path, reload to populate. (now it requires exit and restart)
    - request or bug, depends on you. can't type a part number in direct. error right away. (file not found)

    3rd bugs
    - so far all I see is tris sets the port, and initial state sets tris. port g on 16f1947 tris and portl are correct. only 5 pins for G, maybe thats it?
    - tried it with a 16f676, device has 12 I/O a0..5 and c0..5 wizard configures for 8 and 8. gets the names correct.
    - initially on startup, "select device" text is not there. if I max the window, its there.


    Overall awesome! Looking forward to more!
    Hello Bert,

    Thanks much for the comments. I'm working on Items 2 and 3, hope to have the next rev sometime today.

    Best Regards,
    Paul

Members who have read this thread : 0

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

Posting Permissions

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