Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 19
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
No birthdays today

Next birthdays
05/04 Matthew T. (35)
05/04 Amrit Deshmukh (60)
05/05 Alexandre (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 »   

Help with PIC programming.

1 2 
Move Thread LAN_403
ReddyK
Fri Aug 18 2006, 03:07PM Print
ReddyK Registered Member #92 Joined: Thu Feb 09 2006, 03:11PM
Location: Indian Trail, NC
Posts: 39
Hello,
I do not know the first thing about PICs however, it seems that a PIC would be the best solution to my problem. I want to turn on 10 leds in succession and then reset and do it again. I tend to be 'a search the internet until I find it and then copy it kind of guy'. I have searched but not found any PIC programs that do what I want. If someone would be willing to write the code for me I would gladly pay them for thier time.

I have a universal programmer that I bought to burn chips for my car and it does PICs. I would love to learn C language or somthing like it but it just does not seem to make sense to me yet. I found a C language class to download but it only works on XP which I don't have. I have gone through two tutorials on programming they just didn't have much on the code and what it means. They quickly went to how to burn a chip or talk about problems with the programmers.

Any help would be appreciated.
Thanks,
Steve

Back to top
Wolfram
Fri Aug 18 2006, 04:14PM
Wolfram Registered Member #33 Joined: Sat Feb 04 2006, 01:31PM
Location: Norway
Posts: 971
A simple running light? A CMOS 4017 would propably be the simplest solution to that. However, making it with a microcontroller would give a lot more flexibility (different patterns etc.). I'd suggest learing assembly language, as PIC assembly is quite easy to learn (only 35 instructions, and many of them are in the same group, so if you know one of them you know all of them).
Back to top
ReddyK
Fri Aug 18 2006, 07:07PM
ReddyK Registered Member #92 Joined: Thu Feb 09 2006, 03:11PM
Location: Indian Trail, NC
Posts: 39
A running light is all I can seem to find however, I need the lights to come on in succession and stay on until all are lit and then reset. I find alot of sequence light variations but, none keep the light on they just flash them.
Thanks,
Steve
Back to top
Jrz126
Fri Aug 18 2006, 08:20PM
Jrz126 Registered Member #242 Joined: Thu Feb 23 2006, 11:37PM
Location: Erie PA
Posts: 210
do you need 10? or you be able to get away with 8?

You could do this pretty easy with a single 8 bit shift register.
The shift input would be connected to +5V, and the reset pin would be connected to the last output. then drive the clock signal (from a 555 or whatever). On each clock pulse, another '1' would be shifted in, turning on the next LED. When a '1' is shifted into the last bit, it will trigger the circuit to reset and start again.

Though you really arent limited to 8, you could cascade as many shift registers as you wanted.
Back to top
ReddyK
Fri Aug 18 2006, 10:30PM
ReddyK Registered Member #92 Joined: Thu Feb 09 2006, 03:11PM
Location: Indian Trail, NC
Posts: 39
Yea I really need at least 10 leds and 12 would probibly look better. They are for turn signals on my bike. I made led turn signals and a 120 surface mount led tail light. I didn't think the turn signals were flashy enough and decided to make them sequence somehow. So here I am looking for help to accomplish this.
Thanks,
Steve
Back to top
Bjørn
Fri Aug 18 2006, 11:32PM
Bjørn Registered Member #27 Joined: Fri Feb 03 2006, 02:20AM
Location: Hyperborea
Posts: 2058
The line should read "include <p16f84.inc>", the forum software is buggy. I have not tested it, I just wrote it down.


list    p=16f84
	include <p16f84.inc>
	__config _XT_OSC & _WDT_OFF & _PWRTE_ON & _CP_OFF

	CBLOCK	.12
	  t1
	  t2
	ENDC



main	movlw	.0
	banksel	TRISA
	movwf	TRISA
	banksel	TRISB
	movwf	TRISB
	banksel 0

loop	clrf	PORTA
	clrf	PORTB

	bsf	PORTA,0
	call	pause
	bsf	PORTA,1
	call	pause
	bsf	PORTA,2
	call	pause
	bsf	PORTA,3
	call	pause

	bsf	PORTB,0
	call	pause
	bsf	PORTB,1
	call	pause
	bsf	PORTB,2
	call	pause
	bsf	PORTB,3
	call	pause
	bsf	PORTB,4
	call	pausw
	bsf	PORTB,5
	call	pause
	bsf	PORTB,6
	call	pause
	bsf	PORTA,7
	call	pause

	goto	loop


pause	clrf	t1
pl1	clrf	t2
pl2	decfsz	t2
	goto	pl2
	decfsz	t1
	goto	pl1
	return

	end
Back to top
McFluffin
Sat Aug 19 2006, 07:22AM
McFluffin Registered Member #119 Joined: Fri Feb 10 2006, 06:26AM
Location: USA
Posts: 114
I'd go for the micro just because I'm a C programmer and its good experience, but, that aside, there is a fairly easy way to do 10 as Jrz126 said. Use a 4017 decade counter chip and drive it with a 555. That will give you 10 outputs and is easy to set up.
Back to top
phil
Sun Aug 27 2006, 06:28AM
phil Registered Member #314 Joined: Mon Mar 13 2006, 03:12AM
Location:
Posts: 52
This is the chip i normally use, supports 33 I/O 's so you have a little room to expand if you'd like cheesey . just go here Link2 . and if you only need one chip you can create an account and "sample" up to 4 chips a month. just go under the "samples" section of the web and look up the chip in the link i posted. It also has an ICSP, also known as an "in circuit serial programmer", so you don't need an expensive PIC programmer to program it. The serial port hookup is in the datasheet which can also be found on the site.
Back to top
tecNik
Wed Aug 30 2006, 10:21AM
tecNik Registered Member #77 Joined: Thu Feb 09 2006, 10:24AM
Location: Leicestershire, England
Posts: 26
The LM3916 bargraph display driver supports 10 outputs, can drive LED's directly and can be sampled from National. You just need to provide a rising analog input for what you want. Easy with simple cap charge/discharge circuit (or 555).
Back to top
ReddyK
Wed Aug 30 2006, 04:05PM
ReddyK Registered Member #92 Joined: Thu Feb 09 2006, 03:11PM
Location: Indian Trail, NC
Posts: 39
Thanks for the advice. I have power 8-bit shift registers and an assortment if pics on order. My led's are 80ma so I have to be careful what I am driving them through. I'll let you know how it's going when I get the parts.
Thanks,
Steve
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.