Searching \ for 'Help with first LED program' 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/displays.htm?key=led
Search entire site for: 'Help with first LED program'.

Truncated match.
PICList Thread
'Help with first LED program'
2000\04\22@193934 by Brian Gracia

flavicon
face
Hello Everyone,

I am so frustrated!!!!!  I purchased the DT001 programmer, and am using it
with Pic16Pro Light to program a 16F84.  For the circuit, I have copied the
"Circuit for Experiments" on page 16 although I am not using everything.
Here is a basic description of the circuit.  I am using a 4MHz resonator
center pin to ground, one pin to osc1, the other to osc2.  I have LEDs with
long lead tied to portb through 680 ohm resistors, the other tied to
ground.  For the reset circuit, I have MCLR tied to 5v through a 100 and
10K ohm resistors.  A switch drops MCLR to ground through the 100 ohm
resistor.  The program I am using is as follows.

;======Pict1.asm==========================================1/09/2000===========
       list    p=16f84
       radix   hex
       include <p16f84.inc>
__CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON
;-----------------------------------------------------------------------------
;       cpu equates  (memory map)
portb   equ     0x06
;-----------------------------------------------------------------------------
       org     0x000

start   movlw   0x00    ;load W with 0x00
       tris    portb   ;copy W tristate, port P

                       ;define outputs
       movlw   0x0f    ;load W with 0x0f
       movwf   portb   ;load port B with contents
                       ;of W
circle  goto    circle  ;done, just loop
;
       end

Now, I can use Pic16Pro light to erase, program, verify the 16F84 in the
DT001 programmer.  Don was nice enough to help with the setup of Pic16Pro
light software for use with the programmer.  Now, when I put the 84 in the
circuit and power up, nothing happens.

Does anyone have any clues?

Thanks,
Brian
********************************************
Better Produce through Better Control
********************************************

2000\04\23@090340 by Andy Kelley

picon face
try turning the leds aroiund.

Andy K.

On Sat, 22 Apr 2000 18:38:59 -0500 Brian Gracia <spam_OUTbgraciaTakeThisOuTspamTELOCITY.COM>
writes:
{Quote hidden}

;======Pict1.asm==========================================1/09/2000======
=====
>         list    p=16f84
>         radix   hex
>         include <p16f84.inc>
>  __CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON
>
;------------------------------------------------------------------------
-----
> ;       cpu equates  (memory map)
> portb   equ     0x06
>
;------------------------------------------------------------------------
-----
{Quote hidden}

________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
dl.http://www.juno.com/get/tagj.

2000\04\23@092212 by Brian Gracia

flavicon
face
At 07:57 AM 04/23/2000 , you wrote:
>try turning the leds aroiund.
>
>Andy K.
>

Tried that, no go.

Thanks,
Brian
********************************************
Better Produce through Better Control
********************************************

2000\04\23@092558 by boss

flavicon
face
Another thing you may try is to unbalance the resonator. Sometimes they
won't start oscillation. Put a resistor (maybe 5k - 10k) from one end pin to
ground. Alternately try a low value ceramic capacitor.

{Original Message removed}

2000\04\23@131000 by vehasmaa.No.More.Spam

flavicon
face
Brian Gracia wrote:
{Quote hidden}

Are the leds correct way? if wrong way then tey will no light up.

MLCR pin? is it floting? Should go to Vcc (+5v)

J.M. Vehasmaa

2000\04\24@042956 by is tolley

flavicon
face
On Sat, 22 Apr 2000 18:38:59 -0500 Brian Gracia <.....bgraciaKILLspamspam@spam@TELOCITY.COM>
writes:
> Hello Everyone,
>
> I am so frustrated!!!!!  I purchased the DT001 programmer, and am
> using it
> with Pic16Pro Light to program a 16F84.  For the circuit, I have
> copied the
> "Circuit for Experiments" on page 16 although I am not using
> everything.
> Here is a basic description of the circuit.  I am using a 4MHz
> resonator
> center pin to ground, one pin to osc1, the other to osc2.  I have
> LEDs with
> long lead tied to portb through 680 ohm resistors, the other tied to
> ground.  For the reset circuit, I have MCLR tied to 5v through a 100
> and
> 10K ohm resistors.  A switch drops MCLR to ground through the 100
> ohm
hi a couple of thoughts for you
slightly modified program now uses bank switching for TRIS
a good habit to get into for the bigger micros
;======Pict1.asm==========================================1/09/2000=========
==
        list    p=16f84
        radix   hex
        include <p16f84.inc>
 __CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON
;---------------------------------------------------------------------------
--
;       cpu equates  (memory map)
portb   equ     0x06
;---------------------------------------------------------------------------
--
        org          0x000
        goto        start

start  bsf           STATUS,5   ;change to bank 1 portb tris reg
        movlw     00h               ;load w with 0
        movwf     TRISB          ;set direction to output
        bcf           STATUS,5   ;back to bank 0

        clrf           PORTB          ;clear any spurious data on portb

        movlw      0x0f               ;load W with 0x0f
        movwf      PORTB         ;load port B with contents
                         ;of W bits 0 to 3
circle  goto    circle   ;done, just loop

end

pic checks
+5v to pin 14
0 v to pin 5
resonator across pins 15 + 16 with load capacitors to 0 volt
something around 22pf will be quite happy
pin 4 mclr pullup resistor to + 5v  1k is quite happy
make sure the led is working before connecting to pic
one less thing to worry about
i have the circuit running but i'm using an xtal but its all happy
give it a try
all the best chris

chrisspamKILLspam3rd-age-control.co.uk
Theatre lighting control
Intelligent interfacing for digital control

2000\04\24@073147 by Russell McMahon
picon face
I'll leave others to comment on code,

BUT

make sure the LEDs are the correct way around !!! :-)

Try one which goes to Vcc instead of to PIC. If it lights you are OK - will
light of course when PIC pin goes high.
If it doesn't light like this then the PIC will also not succeed :-).


     Russell McMahon
_____________________________

>From other worlds - http://www.easttimor.com
                               http://www.sudan.com

What can one would be LED lighter* do?
Help the hungry at no cost to yourself!
at  http://www.thehungersite.com/

(* - or woman, child or internet enabled intelligent entity :-))

2000\04\24@101158 by paulb

flavicon
face
(Sorry, can't resist this!)

chris tolley wrote:

> slightly modified program now uses bank switching for TRIS
> a good habit to get into for the bigger micros

 Why?  What's wrong with concise, efficient programming using all
features of the processor to best advantage?  Can you name a PIC on
which TRIS does not work?
--
 Cheers,
       Paul B.

2000\04\24@131736 by Russell McMahon

picon face
>(Sorry, can't resist this!)
>
>chris tolley wrote:
>
>> slightly modified program now uses bank switching for TRIS
>> a good habit to get into for the bigger micros
>
>  Why?  What's wrong with concise, efficient programming using all
>features of the processor to best advantage?  Can you name a PIC on
>which TRIS does not work?
>--
>  Cheers,
>        Paul B.



BECAUSE

The data sheet (OK some data sheets ;-)) say you shouldn't. It's bad enough
doing things that the data sheet doesn't actually mention (but that you just
KNOW that you really shouldn't) without actually doing things that they
recommend against. That said, I'd use TRIS - also probably 2 digits for year
dates if the year was 198x or thereabouts :-) - such efficient practices
help keep people on their toes if the code lasts longer than expected :-) .
Nothing like guaranteed employment for us by-then geriatrics, sniffing out
bugs of our own making.

>Can you name a PIC on
>which TRIS does not work?

Yes - the 16F977 - to be announced later this year and available early next
year and ...
Or perhaps the 16F877b die shrink plus improvements, or ...




RM

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