I need some help please - Page 1
Forum section: electronics / beginners

author: Electronics-Repairman
author_rank: Contributor
timestamp: October 11, 2014, 12:36:45 pm
content: Hello ,Does anyone know off a small simple circuit, I can use with those tactile switches, touch on,touch off,it's for a frequency counter I'm building, it's an evolving project ,that I've learned a lot from,including pic-chip programming, I,want to use these type of switches for pre-scaler & fast & Slow counting.Thank you in advance, for any advice given.Paul

author: SeanB
author_rank: Super Contributor
timestamp: October 11, 2014, 12:42:39 pm
content: 2 CMOS inverters can be coupled to give a latching action using just them and a few resistors and a capacitor. IIRC Dave did do a video on using them like that.

author: Simon
author_rank: Unknown
timestamp: October 11, 2014, 12:44:38 pm
content: if your building circuits with counters you must already know the necessary flip flop to do this

author: Simon
author_rank: Unknown
timestamp: October 11, 2014, 06:51:56 pm
content: Ah then you need a flipflop, look up counters, I don't remember off the top of my head but the basic flipflop elements actually do what you ask for, counters are also frequency dividers.

author: Andy Watson
author_rank: Super Contributor
timestamp: October 11, 2014, 06:59:07 pm
content: If you are using the single-contact "tactile" push buttons you will almost certainly need to consider de-bouncing.I would throw another PIC at the problem - one of the small 12Fxxx series.

author: Simon
author_rank: Unknown
timestamp: October 11, 2014, 07:10:42 pm
content: Well there are debouncing methods but yes you can throw and MCU at it.

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 11, 2014, 07:35:13 pm
content: http://www.epanorama.net/sff/Digital/Misc/Assorted%20Flip%20Flops.pdf

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 11, 2014, 07:45:48 pm
content: Note that if you are controlling something that is implemented as code running on a microcontroller, the "proper" way to do this is by simply connecting pushbutton(s) directly to microcontroller input pins, and handle the alternate-action (on-off or whatever) in software. This is quite simple to do and would be an excellent learning opportunity to get into programming.

author: Simon
author_rank: Unknown
timestamp: October 11, 2014, 08:06:40 pm
content: I get the impression the original microcontroller is a "black box" for the OP that he's trying to interface too, the whole thing could be done in one uC

author: Simon
author_rank: Unknown
timestamp: October 11, 2014, 08:34:33 pm
content: Well if the device is already programmed then you have little to no hope. What you can do is get the original code and modify it if it's available to you.

author: Simon
author_rank: Unknown
timestamp: October 11, 2014, 08:56:42 pm
content: You can't modify a Hex file unless your talking assembly code. Far easier if you have the source C files so that you can edit and recompile.

author: Simon
author_rank: Unknown
timestamp: October 11, 2014, 09:08:26 pm
content: assembly is a step back, everything is done in c now unless your choosing to be a dinosaur

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 11, 2014, 09:40:38 pm
content: There is still a place for assembly (or even direct machine code) development "right down on the bare metal".Cheap memory and fast processing has made people lazy, sloppy and complacent.There are probably several super-critical areas of development that still benefit from machine-level coding.And I would wager that those of us who started out at the assembly-level in programming probably write better/more efficient higher-level code.

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 11, 2014, 10:20:37 pm
content: HEX ("hexa-decimal") is not a programming language or mode. It is simply a method of STORING or ENCODING the firmware so it can be loaded into the microcontroller. It uses the ASCII characters "0" through "9" and "A" through "F" to represent the binary values 0000 through 1111. It is raw machine code.It might be possible to dis-assemble the hex code so you can see the machine language "source" that the hex came from. But you don't write code in "hex".Hopefully, your project is open-source and you can get the source code and modify it as you wish. If not, you can probably find an open-source equivalent somewhere.

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 11, 2014, 10:36:42 pm
content: You understand that the HEX file is NOT the "source", right? Has the author sent you the source code? What language is it in?

author: LukeW
author_rank: Frequent Contributor
timestamp: October 12, 2014, 12:46:43 am
content: To make a latch on/off output using a momentary pushbutton switch you can use a 555.This is one way, there are numerous other possible solutions as with most electronics problems, but you may find that this is cheaper/easier/already available in your parts box, compared to the obvious "textbook" answer which is using a flip-flop. (Although we note that a 555 contains a flip-flop in it.)http://www.bowdenshobbycircuits.info/page9.htm#555-T.gif

author: Simon
author_rank: Unknown
timestamp: October 12, 2014, 06:40:27 am
content: Quote from: Richard Crowley on October 11, 2014, 09:40:38 pmusually time sensitive code is written in assembly, yes in theory you can do anything in assembly but these days your just making life hard for yourself. I could never get my head around assembly but spent years trying as i was taking the advice of stupid idiot dinosaurs on another forum that told me that assembly was "THE ONLY" way. I eventually broke free into basic and then learnt C having moved from pic to AVR, I don't know which is easier as I've learnt a lot since i left pics behind but I'd not be where I am (designing safety critical systems for a mechanical employer) without C and I'd not be getting much help from the wider community if i insisted on being a dinosaur.

author: PA0PBZ
author_rank: Super Contributor
timestamp: October 12, 2014, 10:49:59 am
content: Quote from: Richard Crowley on October 11, 2014, 10:20:37 pmDepending on your definition of "writing" I have to disagree. I once had to modify a typewriter firmware to add a parallel interface to it, and of course all I had was the EPROM dump and the processor datasheet. So I made a quick and dirty dissasembler in Basic, studied the dissassembly and added several hundred bytes of code in hex by hand. But I agree that is far from normalStill I (and others I'm sure) use hex to patch pieces of code to make them accept the keys you enter or simular stuff...

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 12, 2014, 11:39:41 am
content: Quote from: PA0PBZ on October 12, 2014, 10:49:59 amYes, exactly. "writing" (i.e. major development) is NOT the same as modifying existing code.But Electronics-Repairman doesn't appear to be up to the challenge of either at this point.mikeselectricstuff has posted some interesting video of hacking firmware.I believe it was his video about the luggage X-ray scanner.