Searching \ for '[PIC]: Incredibly simple program works in simulato' 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=pic
Search entire site for: 'Incredibly simple program works in simulato'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Incredibly simple program works in simulato'
2001\08\06@012857 by Andrew E. Kalman

flavicon
face
Re:

>In an effort to try to debug the program that I am having trouble with, I
>have stripped it down to the very basic essentials. It is now a program

etc.

Again, you have a typo:

>         while(1)  // loop forever
>         {
>                 RC6=1;
>                 DelayMs(2) ;
>                 if (RA4 = 1)
>                 {

..

should be if (RA4 == 1)

Anyway, your _existing_ program toggles RD7 and RD6 every 92us on a
PIC16C77 @ 20MHz.

If you are running with a _crystal_, then there are a variety of
reasons why it might not start, though frankly I've never had any
problems with PICs and xtals.  If you're running with an external
oscillator-in-a-can (like what's on the PICDEM-2 board), that
eliminates yet more variables. The schematic in our Assembly Guide
AG-1 available on our website may be useful to you ...

One problem I've had with windowed parts is that they behave very
strangely if they are nut fully UV erased prior to (re-)programming.

You  don't mention what your "board" is ...

--

 ______________________________________
Andrew E. Kalman, Ph.D.


Salvo(TM), The RTOS that runs in tiny places(TM)
Pumpkin, Inc.
750 Naples Street
San Francisco, CA 94112
tel: (415) 584-6360
fax: (415) 585-7948
web: http://www.pumpkininc.com
email: spam_OUTaekTakeThisOuTspampumpkininc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\06@122908 by Ed Troy

flavicon
face
I have corrected the typo, although that would not have stopped something
from toggling. I checked my circuit, and it is basically the same as yours.
The only difference is that I hardwired ~MCLR to +5 volts. The rise time is
good, and I have tried triggering that pin separately, but nothing happens
on the board. I've tried several 16C74B chips, and I have tried erasing
them as long as 40 minutes. My programmer, a TopMax, shows the erase to be
ok, and shows no problem with the programming. But, now matter what I do,
the only "activity" that  I see on the chip is the oscillator input signal
on pin 13, which is a very precise 0 to 5 volt 5 MHz signal derived from a
TCXO. Pin 14 shows a triangular waveform going from 0 to about 1.8 volts.
(I currently have the configuration set for XT crystal. I've tried HS and
RC. The best waveform on pin 14 was with RC selected, as I recall, but I
believe I should be using either HS or XT since it is a single-ended clock
signal derived from a discrete temperature compersated, ovenized crystal
oscillator. I am at a total loss to figure out what I am doing wrong. The
circuit is one I designed and layed out. It is very simple, with pins 1,
11, and 32 tied to +5V (eventually +3.3) and 12 and 31 tied to ground. 1
and 20 have 10K pullup resistors. Most pins are unused except for the ones
that I am using for the SPI bus (which is strictly outgoing, so it only
requires 3 wires, to program a National Semiconductor synthesizer chip
(LMX2306). I use pins 17, 18, and 24 for this, for latch, clock, and data,
respectively. I am beginning to think that I have bad 16C74B chips, but I
find it very unlikely that I have 2 bad chips. Also, the programmer
indicates no problem.

I disable watchdog timer, enable power up timer, and disable brownout
feature. (Although I have tried other combinations, to no avail.)

Any any additional thoughts or suggestions would be appreciated.

Ed

At 10:27 PM 8/5/2001 -0700, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\06@144218 by Andrew E. Kalman

flavicon
face
>I have corrected the typo, although that would not have stopped something
>from toggling. I checked my circuit, and it is basically the same as yours.
>The only difference is that I hardwired ~MCLR to +5 volts. The rise time is


etc.

I can only offer a few more suggestions:

1) Use an even simpler program for the test. e.g.

main() {
    TRISD = 0x00;
    PORTD = 0x55;
here:
    goto here;
}

No matter what else is going on in the system, PORTD should get stuck
at 0x55, and resets won't affect that.

2) Are you sure you're building the application for the 1674B? It
might be for another chip ...

Regards,

--

 ______________________________________
  Andrew E. Kalman, Ph.D.   aekspamKILLspampumpkininc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\08\07@172509 by Ed Troy

flavicon
face
Incredible!! Even this does not work. I am doing something incredibly
stupid, but I can't figure out what it is. Either that, or my programmer (a
Topmax) is totally bad, and saying that it is programming chips, and
verifying them, but not, and I can't believe that. Basically, I am now
using a 16F874 chip, because it is quick and easy to erase, and I cannot
get any code to work, although everything I try works fine in the
simulator. Also, I have noticed that in spite of putting in a line
TRISD=0x00, (or TRIS whatever), all ports appear to be tristated and
sitting at 0, since a 10k pullup resistor easily pulls them to high. The
only ports on my device that are at 1 are RD0 and RD1, because they are
pulled up by external pullups. (But, nothing I do can get them to 0.)

At this point, I am suspecting some strange hardware or programmer problem.
Does anyone have a simple (even as simple as the code attached below), that
is compiled for a 16F874. All I need is the hex file, and a brief
explanation of what it does, as long as the hex file is known to work on
actual hardware? Then, I could load that into one of my devices and see
what it does on the actual board.

TIA,
Ed
At 11:35 AM 8/6/2001 -0700, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\07@173725 by Dale Botkin

flavicon
face
Maybe I'm coming in late on this one, but...

Is your oscillator oscillating?  Can I safely assume you've tried a
different (lower frequency maybe even) xtal?  It *is* a parallel resonant
xtal and not series resonant, right?

Dale

On Tue, 7 Aug 2001, Ed Troy wrote:

{Quote hidden}

--
A train stops at a train station.  A bus stops at a bus station.
On my desk I have a workstation...

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\07@173742 by David VanHorn

flavicon
face
At 05:12 PM 8/7/01 -0400, Ed Troy wrote:
>Incredible!! Even this does not work. I am doing something incredibly
>stupid, but I can't figure out what it is. Either that, or my programmer (a
>Topmax) is totally bad, and saying that it is programming chips, and
>verifying them, but not, and I can't believe that.

Try this:

Erase all .hex files, and re-assemble/compile.
Maybe you aren't generating new code to put in the chips!
(Or even any code at all!)

If you find a .hex after that, open it with notepad, and see if it looks
rational.
Not full of 00s, or FFs,



--
Dave's Engineering Page: http://www.dvanhorn.org

I would have a link to http://www.findu.com/cgi-bin/find.cgi?KC6ETE-9 here
in my signature line, but due to the inability of sysadmins at TELOCITY to
differentiate a signature line from the text of an email, I am forbidden to
have it.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\07@185636 by Brent Brown

picon face
Hi Ed,

My MegaMax programmer maybe similar to your TopMax
programmer, and I have to manually tell it to program the config
fuses. Even if I hit the "Auto" button, it programs an verifies OK but
does not program the config bits untill I tell it to. Try it in the circuit
and it just doesn't do anything, go back to the programmer and burn
the config fuses and it's all go! This has caught me out heaps of
times, usually when I have been programming 8051's for ages and
forget what I have to do with PICs. I have nominated it to go on the
100 factoids about PICs list.

Brent Brown
Electronic Design Solutions
16 English Street
Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/text: 025 334 069
eMail:  brent.brownspamspam_OUTclear.net.nz

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\07@200533 by Ed Troy

flavicon
face
Actually, I am using an external temperature compensated crystal
oscillator. It provides a 0 to 5 volts square wave to pin 13 at "precisely"
5 MHz (give about 1 part in 10^8 or so). I have tried using HS oscillator,
XT oscillator, and RC oscillator. I get a nice square wave on pin 14 with
the RC oscillator selected, at, if I recall, 1/4 the basic clock frequency,
but generally I have been using HS oscillator setting, since that is what I
was told to do by Microchip, although that results in a 5 MHz messy
triangular waveform on pin 14.

Ed

At 04:46 PM 8/7/2001 -0500, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\07@200720 by Ed Troy

flavicon
face
I've done that, and it looks fine. And, since it is such a small program,
the hex file is only a few lines.

At 04:36 PM 8/7/2001 -0500, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\07@202857 by Ed Troy

flavicon
face
I tried that, too. I was doing it wrong at first, and the people who make
the TopMax told me I have to burn the configuration fuses after programming
the chip, so that is what I have been doing for the last few days, (and
I've tried all sorts of combinations of configurations) and sitll, nothing
happens.

Ed

At 10:57 AM 8/8/2001 +1200, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\07@211219 by Tony Nixon

flavicon
picon face
Ed Troy wrote:
>
> I tried that, too. I was doing it wrong at first, and the people who make
> the TopMax told me I have to burn the configuration fuses after programming
> the chip, so that is what I have been doing for the last few days, (and
> I've tried all sorts of combinations of configurations) and sitll, nothing
> happens.


Can you email the ASM file. Perhaps I can assemble and burn it into a
chip using a PICstart+ and see how it goes.


--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
RemoveMEsalesTakeThisOuTspambubblesoftonline.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\08\08@005618 by Tony Nixon

flavicon
picon face
Ed Troy wrote:
>
> Tony,
> Here are all of the files that I have. I think the .lst file is what you
> want, but the hex file is what I have been working with.
>
> Thanks for any help,
> Ed

This is your HEX file as dissassembled by my dissassembler, and it does
work when reassembled in MPLAB (16F877)

I programmed it into a 16F877 exactly as is here and read 0x55 on PORTD
using a multimeter.


           ORG 0000h
           ;
           CLRF STATUS
           MOVLW 0x00
           MOVWF PCLATH
           GOTO ad0004
; ??? Duplicate ROM - ad0804
           ;
ad0004      CLRF STATUS
           BCF PCLATH,3
           GOTO ad07F6
; ??? Duplicate ROM - ad0FF6
           ;
           ;
           ORG 07F6h
           ;
ad07F6      BSF STATUS,RP0
           BCF STATUS,RP1
           CLRF PORTE               ; ??? RAM Page TRISE
           CLRF PORTD               ; ??? RAM Page TRISD
           MOVLW 0x55
           BCF STATUS,RP0
           MOVWF PORTD              ; ??? RAM Page TRISD
ad07FD      GOTO ad07FD
; ??? Duplicate ROM - ad0FFD
           ;
           BCF PCLATH,3
           GOTO ad0004
; ??? Duplicate ROM - ad0804
           ;
           ;
           end




--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
spamBeGonesalesspamBeGonespambubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


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