Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Inputs are analogue by default. You need to changed inputs to digital for your application
Button de-bounce is missing.
Here is my attempt:
// random code found on forum
// desperately needs button de-bounce code added
// CONFIG1H
#pragma config FOSC = HSHP // Oscillator Selection bits...
How about something like this:
https://uk.farnell.com/mh-connectors/ga2525mflgk-rc/d-sub-adaptor-25pos-plug-rcpt/dp/2532983
Just poke in the pre-made wires any way you want, then snap on the cover
You may also want this...
Mouser has an obvious choice...
Even this tool requires a little thought before use. There are many options for orientation of ribbon and socket.
Wurth
Disclaimer - I have used a similar press - long ago, but I have not used this exact model
I assume that this device is adjustable for most...
Cannot polish a turd, but I have re-published above code with better formatting and comments as I see it
Maybe OP will spot the errors in his/her own code once the code is more readable?
// random code found on forum - do not blame me, I did not write it!
// need an explanation of what the...
I think I see the problem at the start of the print_float_v7() function:
If number is negative - you change it to positive, so the next test for positive will pass.
This results on the '-' character being overwritten with a space.
Either do the positive test before the negative test...
... or...
You are processing for no button pressed (kp = 0) the same as if a button were pressed, so EEPROM gets filled with zeros.
Here is my attempt at a horrible fix. Still messy, still buggy, but better formatted.
Requires valid entry of 11 numbers, else garbage is saved - but will leave that for you...
First box - The smallest bit is 1 millisecond long. How many bits can you send in a second?
Second box - you have almost the right answer except bit 0 is on the left (after start bit of '0' low), not on the right
EDIT: KlausST beat me to it :)
"Device detected PIC 12F508" is an indication that wiring to PIC has a problem. If you connect nothing, then PIC12F508 is dumbly assumed
If you are using microE development board, then likely problem is jumpers not set correctly (see development board manual).
If you are using own board, then...
Interrupt code would take a lot of explaining, sadly I do not have the patience, nor the teaching skills
If you just accept that the interrupt code works, then any adjustments that you might want to make are in these two lines:
PWM1_high_time = ADC_Read(0)/4...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.