The construction.pps is a winner!
The input and ack you mention already exist and work - although the input is only single bit and so you can only advance the table by one division or by the same number of degrees each step.
I did some time ago start writing a programmable section which would probably do what you require but never finished it - I may look at reviving it.
Sadly it's not likely to allow more than a single input, but as long as your step follows a pattern you could program 8 (or more) absolute positions and it would step to each one in turn before looping back to the start and repeating.
The construction.pps is a winner!
Hello Kwackers (and others..)
Thank you very much for your's configuration bits.
I don't like really using breadboard, and designed/etched quickly a PCB (Eagle).
With a good configuration bits, a valid display appears, but the reset part is totally erratic, and only key number 3 is accepted..... I have to investigate on the keyboard matrix....
I don't know if there is some starting oscillator delay to program as like AVR chips... actually I need around 20 power-on, power-off to have a valid display.
Using Icprog is not the best way, but I have removed Mplab long time ago, because I appreciated very much the Dallas DS89c4xx.
I'm not a professionnal, asm programming is only a hobby, so my device choice is more about pleasure than efficiency....
Best Regards to all, and thanks to share your experience.
Last edited by Rebus; 12-16-2007 at 09:26 AM.
Hi Rebus, glad it's working (after a fashion).
I've never had any trouble with reset - even with a rats-nest construction the device should reset properly on power up.
Some things to check:- One of the 0.1uF capacitors should be close to the PIC to provide supply decoupling. Also check that pin1 (mclr) is tied to VDD. Check the circuitry around the crystal for stray capacitance etc, anything that may prevent the oscillator from starting consistently.
One thing you could try is connecting VDD to mclr via a 10k resistor then resetting by briefly pulling it to VSS - this should tell you whether it's resetting properly or whether there's an issue around the crystal (and 33pf caps).
There is a power on reset delay - this is the power up timer in the configuration bits, you could try enabling this although it shouldn't be necessary.
With regards the keypad - the circuitry around this is very simple. However I can't see the 4 x 10k pull up resistors on your circuit board, these are very important for correct operation. Finally check that pin 2 is at logic 0 - if not this can cause some strange effects (the circuitry around Q1 is responsible for this).
If you need any more help let me know.
Thanks to have a look on my problem.
Resistors are present, but SMD, it is one of the reason why I have changed your layout.
I will try what you say about MCLR.
Now, after a lot of power-up/power-down when I got the presentation menu, the software go to the second menu which is asking a profile number.
Only the three left keys of the upper row are working, and provide a number "3".
I can't go further because all other keys are not reconised.
Using an oscilloscope I see the scan pulses, routed on the corresponding row when a key is pressed, but not accepted....
With a 10k pull-up resistor on MCLR, now the reset is working fine.
But, I'm still locked in the profil menu.
Just an idea, the eeprom memory is empty, because I never save anything.
Does the software is stopped because there is no data previously saved ?
No the program checks to see if the selected profile contains valid data and if not resets all the vars and then saves them back.
I notice you have a sounder attached - it should beep for each key pressed...
I've also attached a keypad checker .hex file (zipped). If you program the PIC with this, when you turn it on you should get a grid of 'O's like so:-
O O O O
O O O O
O O O O
O O O O
Each one corresponds to the relevant key, pressing that key should result in an 'X' appearing instead of the 'O'. Hope this helps.
P.S - don't forget to check pin 2 of the PIC it should be at close to 0v.
As an aside I've had a look at what might cause your reset issue - and the best idea I can come up with is a 'slow' power up. This is covered on page 26 of the data sheet - viewable here:- http://ww1.microchip.com/downloads/e...Doc/39564c.pdf
It's possible the internal resistance of your supply combined with the 470uF capacitor cause the voltage to rise too slowly for a proper reset.
Last edited by kwackers; 12-16-2007 at 01:10 PM.
Pin 2 of the CPU seems to have no effect on my problem, I have fitted a 10k to GND to be sure.
When I press one of the three left upper keys, I got 2 bips, but the result on the LCD is the number "3" for every key pressed.
Thanks for the small kbd test, I will try it, but only at the end of next week.
To morrow morning I will go, as every week to your country, I live in France but I work in London King's Cross.
I will follow this thread from UK.
Thanks you very much for your help, have a good week I will inform you very soon about my test.
Best Regards for all Cnc Zone members.
You should only have one beep... Are the pull up resistors 10k?
The test program should tell you a lot.
You can also try manually 'pulling' the keys, using a short piece of wire and shorting pins 22 & 27 should give you a '1'.
In pin number terms the matrix looks like this.
So shorting pins 20 & 29 should give a .Code:27 28 29 30 22    [Speed] 21    [S] 20    [C] 19 [<]  [>] [G]
Enjoy your week - I don't feel so bad about my 10 minute bicycle commute now... ;-)
This morning I wake up earlier to load your keyboard test in the 18F452, before taking the plane to UK.
First remark, all keys are working !
Second remark, no key pressed, 4x4 matrix on Lcd show 16 cross.
When a key is pressed, three small circles appear in the corresponding column,
I was supposing only one at the proper junction between row and column, where the key is located.
Is this what you have planned in your software ?
Thanks for your answer,
I'm going to have to apologise - when you described the results from the keypad test program the reason was obvious...
I've checked the PCB layout and it confirms it - the 4 x 10k resistors are connected to ground, not 5V.
I drew the circuit diagram from the pcb layout, but either misread the area around the resistors or simply assumed they were 'pull up'...
Hope this is easy to rectify on your own layout - at least you know what the problem is.
Apologies to everyone - the correct circuit diagram is attached (if you're using the original PCB there's no problem because this is correct).
Last edited by kwackers; 12-17-2007 at 07:58 AM.
It is a good new !
Don't apologies, it is interesting to debug also the schematic....
Next friday I will quickly reverse resistors, to GND, and after I hope that I could go throught your software, and energize the stepper motor of my rotary table, before Christmas.
Anyway, thanks a lot for your help, I will post again next weekend, on this forum about my progress.
Best regards for all readers.