Searching \ for '[PIC] pic16f628a code compiling but not verrifying' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'pic16f628a code compiling but not verrifying'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] pic16f628a code compiling but not verrifying'
2009\02\21@013139 by oasisgod

picon face

Hi I'm fairly new to pics and I'm up against a wall here. When I program my
pick (icprog) with the below code the verify will fail. Yet I have no
problem with a bunch of code i downloaded off the net and other projects
that i did durring the summer. So I'm led to believe its my code that is
causing the failure even though it is compiling in MPASWIN with out errors.

The code is intended to drive a single 7 led display to show what gear my
transmission is in. I'm going to use an 8 position switch hooked to the
transmission linkage. The transmission has 1-6 + neutral and reverse. I did
not expect to have this much difficulty doing this since I have 8 inputs and
8 outputs available on the chip meaning no multiplexing, but I am far from a
guru with this stuff.


Right now all the switchs will give the same led output, I was going to
figure the correct pattern out after the chip was functioning.


Any help woul be very appreciated, thank you in advance
----------------------------------------------------------------------------------------------------

       LIST        p=16F628                ;tell assembler what chip we are using
       include "P16F628.inc"                ;include the defaults for the chip
       __config 0x3D18                        ;sets the configuration settings (oscillator type

etc.)


LEDPORT        Equ        PORTB                        ;set constant LEDPORT = 'PORTB'
LEDTRIS Equ        TRISB
SWPORT        Equ        PORTA                        ;set constant SWPORT = 'PORTA'
SWTRIS        Equ        TRISA                        ;set constant for TRIS register
SW1        Equ        7                        ;set constants for the switches
SW2        Equ        6
SW3        Equ        5
SW4        Equ        4
Sw5        Equ        3                        
Sw6        Equ        2
Sw7        Equ        1
Sw8        Equ        0

;end of defines
       
       org        0x0000                        ;org sets the origin, 0x0000 for the 16F628,
                                       ;this is where the program starts running        
       movlw        0x07
       movwf        CMCON                        ;turn comparators off (make it like a 16F84)

         bsf        STATUS,                RP0        ;select bank 1
         movlw        b'00000000'                ;set PortB all outputs
         movwf        LEDTRIS
       movlw        b'11111111'                ;set PortA all inputs
         movwf        SWTRIS
       bcf        STATUS,                RP0        ;select bank 0
       clrf        SWPORT                        ;set all outputs low
       
       bsf        LEDPORT,        1                ;set initial pattern (need edit)




Loop        btfss        SWPORT,        SW1
       call        Switch1
       btfss        SWPORT,        SW2
       call        Switch2
       btfss        SWPORT,        SW3
       call        Switch3
       btfss        SWPORT,        SW4
       call        Switch4
       btfss        SWPORT,        SW5
       call        Switch5
       btfss        SWPORT,        SW6
       call        Switch6
       btfss        SWPORT,        SW7
       call        Switch7
       btfss        SWPORT,        SW8
       call        Switch8
       goto        Loop


Switch1        movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop

Switch2 movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop


Switch3 movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop

Switch4 movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop


Switch5 movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop


Switch6 movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop

Switch7 movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop

Switch8 movlw        b'01111111'
       movwf        LEDPORT
       goto    Loop

       end      



---------------------------------------------------------------------------------------------------
--
View this message in context: www.nabble.com/pic16f628a-code-compiling-but-not-verrifying-need-help-please-tp22129050p22129050.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\02\21@024948 by cdb

flavicon
face


:: __config 0x3D18                        ;sets the configuration
:: settings (oscillator type
::
:: etc.)

Is the part an 628 or 628A ?  Your programmer may get upset if the
part reports itself as a 628A, but the hex file is telling it, it's a
628.

What exactly are your fuse settings?  I can't get any configuration on
my programmer to come up with anything beginning with 0x3Dxx.

I can get 0x3E - which is data protect

I take it that 0x??18 is using internal RC with RB6 set as an in/out
bit.

If you have data or code protect set, then verify will fail, or it
does with my programmer.

Colin


--
cdb, spam_OUTcolinTakeThisOuTspambtech-online.co.uk on 21/02/2009

Web presence: http://www.btech-online.co.uk  

Hosted by:  http://www.1and1.co.uk/?k_id=7988359







2009\02\21@053142 by Wouter van Ooijen

face picon face
> Is the part an 628 or 628A ?  Your programmer may get upset if the
> part reports itself as a 628A, but the hex file is telling it, it's a
> 628.

AFAIK the hex file does not contain any info as to which target chip is
intended.

--

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu

2009\02\21@053814 by cdb

flavicon
face


:: AFAIK the hex file does not contain any info as to which target
:: chip is intended.

Indeed.

Ignore the hex file sentence - reparse statement -  

If your programmer is set for a 628, but the part reports itself as a
628A .............

Colin
--
cdb, .....colinKILLspamspam@spam@btech-online.co.uk on 21/02/2009

Web presence: http://www.btech-online.co.uk  

Hosted by:  http://www.1and1.co.uk/?k_id=7988359







2009\02\21@065743 by Jan-Erik Soderholm

face picon face
oasisgod wrote:

> __config 0x3D18        ;sets the configuration settings
>                       (oscillator type etc.)

Do not use that syntax, you are forcing everyone to
calculate each config setting from your value.
spell out each config bit separately.


The code itself is probably not intersting at all...

The actaul commands and output form your programming tools
are also better then your interpretation of it.

2009\02\21@095432 by olin piclist

face picon face
oasisgod wrote:
> Hi I'm fairly new to pics and I'm up against a wall here. When I
> program my
> pick (icprog) with the below code the verify will fail.

So that sounds like the first thing to chase down.  What does this have to
do with your source code?

> Yet I have no
> problem with a bunch of code i downloaded off the net and other
> projects
> that i did durring the summer. So I'm led to believe its my code that
> is
> causing the failure even though it is compiling in MPASWIN with out
> errors.

How about warnings?  You must have gotten a bunch with opcodes starting in
column 1 like that.

> The code is intended to

If you can't program the HEX file into the PIC, then I don't see how it
matters what the code is intended to do.

> Any help woul be very appreciated, thank you in advance

> LIST p=16F628 ;tell assembler what chip we are using
> include "P16F628.inc" ;include the defaults for the chip
>     ...

Yucc.  You should be ashamed to post such a mess.  Some opcodes start in
column 1, fields aren't lined up in columns to be easy to read, and there
are virtually no comments.  No thanks.

Note that none of these things has anything to do with the content of the
code, which would make them excusable for someone new to PICs.  Basic
neatness and proper formatting of work you want others to look at are
universal concepts that trancend PICs and even programming.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\02\21@095827 by olin piclist

face picon face
cdb wrote:
> Is the part an 628 or 628A ?  Your programmer may get upset if the
> part reports itself as a 628A, but the hex file is telling it, it's a
> 628.

How is the HEX file supposed to tell the programmer what chip the data is
for?  As far as I know, there is no standard way to do this, at least none
that Microchip has published that I am aware of.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\02\21@100114 by olin piclist

face picon face
cdb wrote:
> If your programmer is set for a 628, but the part reports itself as a
> 628A .............

Then any competent programmer would give you a error message, not just fail
to verify the part.  I can tell you for sure that all of my programmers
would never even try to program the part if you explicitly told it the PIC
model and it found a different one connected.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\02\22@024716 by oasisgod

picon face

Thank you for your fast reply and taking the time to try to figure out my
fuses (sorry about that),

The 0x3D18 setting when used with ICPROG sets none of the fuses and sets the
oscillator to IntRC. Idk if this is just true with ICPROG or not. I got the
config number from ICPROG's website.

The chip is a 16f628A, I have now corrected that line, thank you. However I
had MPASWIN set up for the 16f628A and it automatically ignores that line
and goes with the manually set settings in it self. So that wasn't causing
the problem. no dice

I changed Switch1 movlw b'01111111'  to Switch1 movlw b'00000000'  
recompiled it for the 5th time and programmed it with ICPROG and magically
it verrified I have no idea why, now in my finished program that line reads
Switch1        movlw        b'00001001' and it still works fine. So I really can't say
what was causing my problem there's a good chance that when i changed that
line something else happened to make it work and that was just coincidence.
Just to be clear this was before I changed anything else in the program
including the 16f628 line.

Also my code did not function correctly the first time it was on the chip
becuase  clrf SWPORT ;set all outputs low  should have been clrf        LEDPORT

My now very simple code works and I appreciate your help and will make sure
i spell out my fuses, and comment my code better in future post.                        
--
View this message in context: www.nabble.com/pic16f628a-code-compiling-but-not-verrifying-need-help-please-tp22129050p22144357.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\02\22@030143 by oasisgod

picon face

Also sorry about the code being such a mess I didn't realize it got so chewed
up when I cut and pasted it.
--
View this message in context: www.nabble.com/pic16f628a-code-compiling-but-not-verrifying-need-help-please-tp22129050p22144416.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\02\22@061233 by Gerhard Fiedler

picon face
Olin Lathrop wrote:

> Yucc.  You should be ashamed to post such a mess.  Some opcodes start
> in column 1, fields aren't lined up in columns to be easy to read,
> and there are virtually no comments.  No thanks.

That must be a problem on your end. Here, everything looked just fine,
using a simple mail reader that is able to display text/plain content.
No need to think somebody should be ashamed (at least not before you
sent your post :)

Gerhard

2009\02\22@083758 by olin piclist

face picon face
oasisgod wrote:
> Also sorry about the code being such a mess I didn't realize it got
> so chewed up when I cut and pasted it.

It's not clear what this is in reply to, but I guess you are the guy that
posted the messy code having some sort of programming problem?  In any case,
never post code with tab characters in it.  There is no guarantee how tabs
will be interpreted on other systems.  They will probably be interpreted
differently on different apps on your system too.  Leaving tabs in source
files is a bad idea in the first place, but you really need to convert them
to spaces according to your interpretation before showing the code to
others.  This is all of course self-evident, so failing to do this not only
annoys those you are seeking a favor from, but it also makes you look
stupid.

If in doubt with PIC assembler code, you can run my ASPIC_FIX program
(http://www.embedinc.com/pic/dload.htm) over it.  That replaces tabs with
spaces and lines up opcodes, operands, and comments neatly in columns.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\02\22@084430 by olin piclist

face picon face
Gerhard Fiedler wrote:
>> Yucc.  You should be ashamed to post such a mess.  Some opcodes start
>> in column 1, fields aren't lined up in columns to be easy to read,
>> and there are virtually no comments.  No thanks.
>
> That must be a problem on your end. Here, everything looked just fine,
> using a simple mail reader that is able to display text/plain content.

I suspect there were tab characters in this code, which of course get
interpreted different in just about every app on every system.  I was using
Outlook Express on Windows 2000 with no deliberate settings made about tab
interpretation (I don't think there even are any in OE).

> No need to think somebody should be ashamed (at least not before you
> sent your post :)

Sending code with tabs is pretty dumb.  Anyone that knows enough about
computers to be trying to program one should know enough about text formats
to know that leaving tabs in source when showing it to others is a bad idea.
And there still weren't any meaningful comments in the code.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\02\22@091036 by Tony Smith

flavicon
face
> >> Yucc.  You should be ashamed to post such a mess.  Some opcodes start
> >> in column 1, fields aren't lined up in columns to be easy to read,
> >> and there are virtually no comments.  No thanks.
> >
> > That must be a problem on your end. Here, everything looked just fine,
> > using a simple mail reader that is able to display text/plain content.
>
> I suspect there were tab characters in this code, which of course get
> interpreted different in just about every app on every system.  I was
using
> Outlook Express on Windows 2000 with no deliberate settings made about tab
> interpretation (I don't think there even are any in OE).
>
> > No need to think somebody should be ashamed (at least not before you
> > sent your post :)
>
> Sending code with tabs is pretty dumb.  Anyone that knows enough about
> computers to be trying to program one should know enough about text
formats
> to know that leaving tabs in source when showing it to others is a bad
idea.
> And there still weren't any meaningful comments in the code.


And to think someone made a comment about the 'beat-up-the-newbie' custom.

I wonder when this newbie will receive their well deserved blow-up punch
bag.

Geez Olin, haven't you better things to do?

Tony

2009\02\22@212431 by Benjamin Grant

flavicon
face
Olin, your comments were considerably worse than the original post. At least
the original post gave something to work with - neatness and organization
obviously comes with time and you could have pointed this out in a less
condescending manner. If your comments are not technical or instructive in
any manner, but only abusive, it doesn't seem to me they have any place on
the listserve.

2009\02\23@073548 by olin piclist

face picon face
Benjamin Grant wrote:
> neatness and
> organization obviously comes with time and you could have pointed
> this out in a less condescending manner.

No, there was no excuse for such sloppiness and the lack of comments.

********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\02\23@082009 by Jake Anderson

flavicon
face
Gerhard Fiedler wrote:
> Olin Lathrop wrote:
>
>  
>> Yucc.  You should be ashamed to post such a mess.  Some opcodes start
>> in column 1, fields aren't lined up in columns to be easy to read,
>> and there are virtually no comments.  No thanks.
>>    
>
> That must be a problem on your end. Here, everything looked just fine,
> using a simple mail reader that is able to display text/plain content.
> No need to think somebody should be ashamed (at least not before you
> sent your post :)
>
> Gerhard
>  
I think we are sposed to be ashamed that we aren't Olin.

Given that anything known by somebody can also be known by somebody else
without asking Olin, the fact that he sees questions that he knows the
answer to means the person asking the question obviously hasn't done
enough work and as such should be ridiculed.

(because ridicule is the only way people learn (oh and Olin is never
*ever* wrong, he doesn't have opinions, he has facts))

</rant>

Has anybody actually done statistics on his posts? Just to see what %
would be considered insulting by an average person.

2009\02\23@085348 by Tamas Rudnai

face picon face
Guys, if you have a problem with someone try to do that off-list - I think
these messages are too noisy and ruins the quality of piclist.

Tamas


On Mon, Feb 23, 2009 at 1:20 PM, Jake Anderson <jakespamKILLspamvapourforge.com> wrote:

{Quote hidden}

> -

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...