Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 23
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
One birthday today, congrats!
a.gutzeit (63)


Next birthdays
05/07 a.gutzeit (63)
05/08 wpk5008 (34)
05/09 Alfons (36)
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 :: General Science and Electronics
« Previous topic | Next topic »   

PIC Interrupter Program

 1 2 3 
Move Thread LAN_403
EDY19
Fri May 26 2006, 12:37AM
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
Yup, that is exactly what i am looking for, Anders! What chip is it for? Just any PIC? I was thinking the 16F628, did that one have a display as well?
Back to top
Wolfram
Fri May 26 2006, 01:00AM
Wolfram Registered Member #33 Joined: Sat Feb 04 2006, 01:31PM
Location: Norway
Posts: 971
It should work for any PIC12/PIC16.

He wrote three routines, but only one of them seems suitable for this, he gave me permission to post it.

As it stands now minimum on-time is 18µS, adjustable in 3µS steps, max 10s when running the PIC at 4MHz. The same applies to the off-time.

wloop	bsf	PORTB,1
	movfw	on1
	movwf	t1
	movfw	on2
	movwf	t2
	movfw	on3
	movwf	t3
	goto	wl1

wl1	decfsz	t1
	goto	wl1
	nop

	decfsz	t2
	goto	wl1
	nop

	decfsz	t3
	goto	wl1
	nop

	bcf	PORTB,1
	movfw	off1
	movwf	t1
	movfw	off2
	movwf	t2
	movfw	off3
	movwf	t3

wl2	decfsz	t1
	goto	wl2
	nop
	
	decfsz	t2
	goto	wl2
	nop

	decfsz	t3
	goto	wl2
	nop

	goto	wloop

The program was written by Bjørn Bæverfjord.
Back to top
EDY19
Fri May 26 2006, 12:26PM
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
So the output would be on pin 7 on a 16F628, correct? That pin is labeled RB1. Also, I plan on changing the oscillator to 16MHz, so what values would I have to change for the timing, and multiply them by 4 to get the same time, right? Lastly, what compiler/programmers do you use? Thanks for all the help, this is my first programming project ever smile And it would be nice if it worked correctly.
Back to top
Wolfram
Fri May 26 2006, 01:56PM
Wolfram Registered Member #33 Joined: Sat Feb 04 2006, 01:31PM
Location: Norway
Posts: 971
As of now, this is just the code to do the timing. Running it at 12MHz would let you control it in steps of 1µS, with the lowest on-time as 6µS. 6µS is quite a bit when it comes to DRSSTC stuff, so I guess the code would have to be modified to allow lower minimum on-time to be good for DRSSTC stuff.
Back to top
EDY19
Fri May 26 2006, 10:24PM
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
Well, looking at steve wards site
Link2
the burst length goes from 60uS up to 200uS at 120bps, so I don't see how 6 would be a problem. Is 120bps the same as 120 Hz?
Back to top
Steve Conner
Fri May 26 2006, 10:33PM
Steve Conner Registered Member #30 Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
I designed a DRSSTC interrupter circuit with two 555s (or a 556) like what Avalanche suggested. One pot adjusts the frequency from "Single shot" up to 200Hz and the other adjusts the on-time from 5 to 300us. When the frequency pot is turned to "Single shot", pressing the button triggers a single pulse.

Both pots are linear, so you could use 10-turn pots with counter dials and read the frequency and on-time directly. The op-amp is really just there to make the frequency pot linear.

Link2

I've also made an interrupter driven by a PIC, but I decided the analog circuit above was less hassle. It took about a day to design, build and get working. The PIC interrupter was a fancy unit that made clumps of up to 64 pulses with pseudo-random delays between them, the idea being to produce a big fat spark from an old SSTC design that couldn't do anything too impressive with just one pulse.

Yes 120bps is the same as 120Hz.
Back to top
EDY19
Fri May 26 2006, 11:11PM
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
I think that the easiest way for the actual signal is by far the 556 timer. Thats what I think I'll go with just for the sake of not bothering so many people about coding the PIC. But, I still have to make the display, thats one of the requirements for me. Steve, you don't happen to have a PCB file for that 556 or 555 thing, do you? It should be a great thing to have around as a oscillator for lots of different projects, as well. So drop the PIC oscillator thing, I think I will just use it as a display. I found a site
Link2
which has a program labeled weedfreq8x2LCD
which is a frequency counter with an output for a LCD display (8x2) I would like to change this to a 16x2 display though as well as adding on and off times. Hints are greatly appreciated!
When you say "interrupter output active low," does that mean that when the driver is low, that corresponds to the on time? Lastly, I want to cut out the single shot switch from the 556 timer portion and add it to the PIC circuit, there will be a switch to switch modes between single shot and oscillator. In order to do this, I can pretty much just take out the whole IC3A section, and connect the reset of the 555 to Vcc, right?
Sorry for all the questions but i want this project to turn out right! wink
Back to top
Steve Conner
Sat May 27 2006, 02:30PM
Steve Conner Registered Member #30 Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
Hi edy

If you're wanting an LCD readout, I would say it actually becomes easier to do the whole thing digitally in a PIC. I designed my circuit so you could use 10-turn pots with counter dials to get a mechanical readout. If you do bolt a PIC onto an analog pulse generator, you have to deal with problems like:

How do you read the pulse width accurately?
How can you update the display when the fire button isn't pressed (and hence the oscillator is doing nothing)

I also did a PIC interrupter that uses a DDS algorithm to give breakrates from 0 to 1000bps, but I ended up building the analog one because I couldn't be bothered coding a user interface for it.

Yes, the output is high all the time and goes LOW to fire the burst.

No, there is no PCB. It took me less time to slap it together on a piece of stripboard than it would to lay it out in Eagle. Of course I'm not stopping any of you guys designing one if you want to. tongue

The switch isn't a single shot/repetitive select switch, it's a fire button. The unit only gives pulses while the button is pushed in. If you push it while the breakrate pot is turned all the way down, you only get one pulse per push of the button. I don't know how you would adapt that to a PIC. You are right that you wouldn't need IC3A: it's only there to debounce the switch.


1148740227 30 FT10039 Img 1465 Small
Back to top
Wolfram
Sat May 27 2006, 02:46PM
Wolfram Registered Member #33 Joined: Sat Feb 04 2006, 01:31PM
Location: Norway
Posts: 971
Steve, would you mind sharing the code you wrote? I might have the time to code an interface for it.
Back to top
EDY19
Sat May 27 2006, 04:22PM
EDY19 Registered Member #105 Joined: Thu Feb 09 2006, 08:54PM
Location:
Posts: 408
Second thoughts, maybe using the PIC all the way would be easier display wise as well as the single shot and oscillator interface. I was thinking a rotary encoder (say 24 switches per rotation) would be good, as this keeps the information digital instead of using potentiometers. For every 15 degrees the switch is rotated (one pulse) the frequency could jump by 5Hz and the duration of the pulse from 10uS-300uS, with a second mode for single shot or a switch or something. I think this would be easier than using the 555s and the potentiometers for getting the frequency and on/off time displayed.

edit: Trying to think how a rotary encoder can "think" it is going forwards or backwards-wait, i dont think that it can tell tongue . Looks like we may have to go with a potentiometer and an analog to digital converter- darn, more programming...

Edit: Moved to computer science considering it has more to do with programming now
Back to top
 1 2 3 

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.