Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 16
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
One birthday today, congrats!
Vaxian (17)


Next birthdays
05/21 Dalus (34)
05/21 Kizmo (37)
05/22 Skynet (32)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: Computer Science
« Previous topic | Next topic »   

pic16f84a stops running HELP!!!!

1 2 
Move Thread LAN_403
teslacoolguy
Thu Nov 29 2007, 07:33PM Print
teslacoolguy Registered Member #1107 Joined: Thu Nov 08 2007, 10:09PM
Location:
Posts: 792
this is my first pic project so i built a simple program that blinks a bunch of led's connected with bc550 transistors. RA0-RA3 are connected to led's that each go to one letter of my cousin Joey but in led's(see picture)and RB0-RB5 are connected directly to 6 low power ultrabright blue led's(one on each port)that i made flash around the border of my name. The oscillattor is a 10mhz resonater. when i got it all together and powered it up it worked like a charm for about 2-3 seconds and than stopped. i realised after a bunch of poking around that when i touch MCLR and RA4 with my finger it started to work again but after a couple of seconds it stopped. I am really puzzeled so if anyone has any tips plz let me know. Here is the program that works fine on my dev board when using 1 led for each letter and the led's on portB are steady and not flashing(same as in the real thing) the code is in basic

main:
TRISA = 0
TRISB = 0
PORTA = %00000001
PORTB = %00111111
delay_ms(300)
PORTA = %00000011
delay_ms(300)
PORTA = %00000111
delay_ms(300)
PORTA = %00001111
delay_ms(300)
PORTA = %00000000
delay_ms(200)
PORTA = %00001111
delay_ms(200)
PORTA = %00000000
delay_ms(200)
PORTA = %00001111
delay_ms(200)
PORTA = %00000000
delay_ms(200)
PORTA = %00001111
delay_ms(200)
PORTA = %00000000
delay_ms(200)
PORTA = %00001111
delay_ms(200)
PORTA = %00000000
delay_ms(200)
PORTA = %00001111
delay_ms(300)
PORTA = %00001110
delay_ms(300)
PORTA = %00001100
delay_ms(300)
PORTA = %00001000
delay_ms(300)
PORTA = %00000000
delay_ms(300)
goto main
end.

1196364477 1107 FT0 Top

1196364477 1107 FT0 Bottom
Back to top
Bjørn
Thu Nov 29 2007, 08:27PM
Bjørn Registered Member #27 Joined: Fri Feb 03 2006, 02:20AM
Location: Hyperborea
Posts: 2058
It looks a bit like you forgot to ground your reset pin, if that is true it would cause such problems.
Back to top
uzzors2k
Thu Nov 29 2007, 09:35PM
uzzors2k Registered Member #95 Joined: Thu Feb 09 2006, 04:57PM
Location: Norway
Posts: 1308
I thought you had to pull the reset/MCLR pin high?
Back to top
Bjørn
Thu Nov 29 2007, 10:54PM
Bjørn Registered Member #27 Joined: Fri Feb 03 2006, 02:20AM
Location: Hyperborea
Posts: 2058
You are correct, it should be pulled high. It is an active low input.

Usually connecting it directly to VDD in simple circuits like this is fine, but there are some cases where it will not be good enough. Using a resistor fixes most problems but in some cases a delay circuit must be made to make sure the PSU and oscillator is stable before the chip comes out of reset to make sure it does not lock up.
Back to top
Ken M.
Fri Nov 30 2007, 03:07AM
Ken M. Registered Member #618 Joined: Sat Mar 31 2007, 04:15AM
Location: Us-Great Lakes
Posts: 628
If fidgeted with pics before and most have an internal reset system, as for the code...................If ur using basic ur Delay should be "pause X" where pause is the # of milliseconds u want it to pause for. If not just listen to bjorn, he's more informed then I am, also I haven't messed with pics in 2 years...
Back to top
Conundrum
Fri Nov 30 2007, 08:14AM
Conundrum Registered Member #96 Joined: Thu Feb 09 2006, 05:37PM
Location: CI, Earth
Posts: 4059
Also MCLR is vulnerable to ESD, be very careful! i've had this problem and it can cause random lockups.
the fix is to put a 15v zener across this pin if using the chip in an ICSP or other application.

btw this also applies to 12xxx chips.
regards, -A
Back to top
Steve Conner
Fri Nov 30 2007, 10:13AM
Steve Conner Registered Member #30 Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
Yep, looks like you forgot the pull-up resistor on MCLR.
Back to top
uzzors2k
Fri Nov 30 2007, 12:12PM
uzzors2k Registered Member #95 Joined: Thu Feb 09 2006, 04:57PM
Location: Norway
Posts: 1308
WhiteArc wrote ...

If fidgeted with pics before and most have an internal reset system, as for the code...................If ur using basic ur Delay should be "pause X" where pause is the # of milliseconds u want it to pause for. If not just listen to bjorn, he's more informed then I am, also I haven't messed with pics in 2 years...

It looks like Mikrobasic to me, in which case his syntax is ok.
Back to top
Capper
Fri Nov 30 2007, 12:32PM
Capper Registered Member #914 Joined: Fri Jul 20 2007, 06:22PM
Location: South Bend, IN
Posts: 85
Did you disable the watchdog timer? Look at your configuration bits. That was one of my first problems working with PICs.
Back to top
teslacoolguy
Tue Dec 04 2007, 05:32AM
teslacoolguy Registered Member #1107 Joined: Thu Nov 08 2007, 10:09PM
Location:
Posts: 792
problem fixed i dident connect MCLR to the 5v line
Back to top
1 2 

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.