16F914 and MPASM


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1

    Default 16F914 and MPASM

    The following program compiles fine in both PBP and MPASM, but the version compiled with MPASM refuses to run. I'm using V5.14 of MPASM. Programs compiled on other PICS run fine.

    OPTION_REG = %11000000
    INTCON = 0
    PIE1 = 0
    PIE2 = 0
    ANSEL = 0
    TRISA = %00000000
    TRISB = %00100001
    TRISC = %00000000
    TRISD = %00000000
    TRISE = %1000
    OSCCON = %00000001
    CMCON0 = 7
    ADCON0 = 0
    WDTCON = 0

    CLEAR

    LCDPS = %00110000
    LCDSE0 = %11111110
    LCDSE1 = %11111111
    LCDSE2 = %11111111

    LCDDATA0 = $00
    LCDDATA1 = $00
    LCDDATA2 = $00

    PIR2 = 0



    SMCOUNT var byte
    SMCOUNT10 var byte
    SMCOUNT100 var byte

    clear

    LCDCON = %11001000

    PORTA.7 = 0

    Main:


    PORTA.7 = 1
    pause 10
    PORTA.7 = 0
    pause 10
    goto Main

    Anyone have any ideas why this is?

    Thank you for your help.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PORTA.7 share a couple of things

    OSC1
    CLKI
    T1OSI

    My first bet would be that you haven't set the OSC to internal... and if you did

    Code:
    OSCCON=0
    '
    '
    '
    '
    '
    '
    
    OSCCON = %00000001
    this make the whole thing running @ 32KHz
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Yes, it's supposed to be running at 32khz internal. I am programming the '914 via ICSP, and other chips via the ME Labs USB programmer. Do you think this could make a difference?

  4. #4


    Did you find this post helpful? Yes | No

    Default

    O.K., after half a day of fighting this problem, I found the solution. When the MPASM check box is checked, you have the option of checking three additional boxes. I had the box marked "INHX8M" checked. When I checked the "INHX8S" box instead, the programs run O.K.

    Where is this documented?

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    In the MPASM assembler help file, somewhere under Hex file format.
    Code:
    Hex File Formats (.hex, .hxl, .hxh) 
    The MPASM assembler and MPLINK linker are capable of producing ASCII text hex files in different formats.
    
    	Format Name  		Format Type  		File Extension  Use  
    Intel Hex Format  		INHX8M  		.hex  8-bit core device programmers  
    Intel Split Hex Format  	INHX8S  		.hxl, .hxh  odd/even programmers  
    Intel Hex 32 Format  		INHX32  		.hex  16-bit core device programmers
    It's a bit ODD that INHX8S fixed it...
    Last edited by mister_e; - 5th February 2009 at 13:52.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Alas, I was wrong! Iam still unable to program 16F914 using MPASM and ICSD. I can program using PBP, however. I am able to program 12F635 using either PBP or MPASM and the standard 40 pin ZIF socket from MELABS. I have asked MELABS for help with this.

    Thank you for your help Mister e

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