Searching \ for '[PIC] Project with LCD, keys and delays on PIC16F6' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/io/lcd/pic.htm?key=lcd
Search entire site for: 'Project with LCD, keys and delays on PIC16F6'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Project with LCD, keys and delays on PIC16F6'
2009\04\30@030455 by Nick F

picon face

Hi All,
I intend to start a project that uses a LCD display (2x16, parallel data
input), three switches for input, three digital outputs, that each generates
a pulse with a specific width.
Pulse2 and pulse3 come after delay2 and delay3. I want to modify the delays
from 1us to 200us, with a resolution of 1us, as well as the widths of
pulse1, pulse2, pulse3.
For this operation, I think using three switches, as: "Select Next
Parameter/Set Value", "Up", "Down".

Now, I can use assembler or C (limited size code). I have limited experience
with both in the microcontrollers world and if possible, I prefer C. I don't
mind combining them two, if necessary.

I would like somebody with more experience than me to advise about the
structure of the program.
Should I use interrupts, timers, etc? How should I deal with the LCD? I only
need the LCD to view and set the parameters, so the LCD could come to life
only when I press on the "Select Next Parameter" Key.
The values set for pulse widths and delays should be stored into the EEprom.
In the past I tried using some libraries of "precise delays" in C, but the
delays I obtained were nowhere what I expected. I will give it another try
anyway.

Any advice appreciated.

Regards,
Nick




--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23309866.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@042045 by Jan-Erik Soderholm

face picon face


Nick_F wrote:
> Hi All,
> I intend to start a project that uses a LCD display (2x16, parallel data
> input), three switches for input, three digital outputs, that each generates
> a pulse with a specific width.
> Pulse2 and pulse3 come after delay2 and delay3. I want to modify the delays
> from 1us to 200us, with a resolution of 1us, as well as the widths of
> pulse1, pulse2, pulse3.
> For this operation, I think using three switches, as: "Select Next
> Parameter/Set Value", "Up", "Down".
>
> Now, I can use assembler or C (limited size code). I have limited experience
> with both in the microcontrollers world and if possible, I prefer C. I don't
> mind combining them two, if necessary.
>
> I would like somebody with more experience than me to advise about the
> structure of the program.
> Should I use interrupts, timers, etc?

Yes, absolutely.
Use as much as possible of what the selected processor has tooffer !

> How should I deal with the LCD? I only
> need the LCD to view and set the parameters, so the LCD could come to life
> only when I press on the "Select Next Parameter" Key.
> The values set for pulse widths and delays should be stored into the EEprom.
> In the past I tried using some libraries of "precise delays" in C,

Probably using software-delays. Use timers instead.

Are you locked to the 628A ?
Is this an one-off project or will it be build in large amounts ?
By using a more modern PIC (maybe an low-end PIC18) you get more
"things" (like better timers, table-lookup and so on) to play with.


{Quote hidden}

2009\04\30@061452 by Jinx

face picon face
> By using a more modern PIC (maybe an low-end PIC18) you get more
> "things" (like better timers, table-lookup and so on) to play with.

An 18F would also at least double the maximum clock speed. Delays
and pulses with 1us resolution is going to be a lot easier with a 40MHz
clock than a 20MHz. I used 50Mhz Scenix's (equivalent to a 200MHz
PIC, almost 50MIPS) for a stepper motor controller project as no PIC
was fast enough for the data-fed loops needed

2009\04\30@065924 by Nick F

picon face



Jinx-4 wrote:
>
>> By using a more modern PIC (maybe an low-end PIC18) you get more
>> "things" (like better timers, table-lookup and so on) to play with.
>
> An 18F would also at least double the maximum clock speed. Delays
> and pulses with 1us resolution is going to be a lot easier with a 40MHz
> clock than a 20MHz. I used 50Mhz Scenix's (equivalent to a 200MHz
> PIC, almost 50MIPS) for a stepper motor controller project as no PIC
> was fast enough for the data-fed loops needed
> --

2009\04\30@070640 by Nick F

picon face


Jan-Erik Soderholm wrote:
{Quote hidden}

--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23314096.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@070840 by VICENTE COLOMAR PRATS

picon face
Wow, I never used such a stepper motor. The most a 0.9 º/step wich gives
400kHz. Really need a 50 MIPS micro ONLY for a stepper?

2009/4/30, Jinx <spam_OUTjoecolquittTakeThisOuTspamclear.net.nz>:
>
> An 18F would also at least double the maximum clock speed. Delays
> and pulses with 1us resolution is going to be a lot easier with a 40MHz
> clock than a 20MHz. I used 50Mhz Scenix's (equivalent to a 200MHz
> PIC, almost 50MIPS) for a stepper motor controller project as no PIC
> was fast enough for the data-fed loops needed
>

2009\04\30@073833 by Jan-Erik Soderholm

face picon face

Nick_F wrote:
> As far as I know, a 20MHz PIC16F628A can have a resolution of 200nS,

Exactly what do you meen with "resolution" ?
200 ns is the fastest instruction time, but that doesn't
give you any practical "resolution" in most applications.

2009\04\30@075841 by Jinx

face picon face
> As far as I know, a 20MHz PIC16F628A can have a resolution
> of 200nS, which is 5 times better than my desired 1us

Yes it does, but you need at least 2 (possibly 3) cycles to make a pulse

bsf ;set pin
nop ;if read-modify-write is a problem, which it isn't for the 18F
bcf ;clear pin

and on top of that you need cycles to get to that sequence / return / do a
loop for longer pulses etc. However, I may be making too much of this if
you're wanting to do just a single pulse rather than a pulse train

> At the moment I think a faster PIC would be required mostly to
> supplement poor programming skills. At the moment I know very little,
> so it would be even worse to learn something more complex

I hear what you're saying but the logic need not necessarily be complex.
Making a pulse is a fairly simple task and there's a limit to how efficient
you can make the code, no matter how much you try

I can see that you could use several methods to get the pulse you want ;

>From 1us up to a certain length

bsf
(X * nop)
bcf

>From there to another length, an 8-bit decrement

bsf
decfsz X
bra $-1
bcf

After that I think you'll need to go to a 16-bit decrement. For example
200us is 1000 instruction cycles

2009\04\30@081253 by Jinx

face picon face
> Wow, I never used such a stepper motor. The most a 0.9 º/step wich
> gives 400kHz. Really need a 50 MIPS micro ONLY for a stepper?

Yes. Although the speed of the SX was really needed because the pulse
timing loops used varying 16-bit data. The actual maximum pulse frequency
was 250kHz IIRC

It was for a stabiliser. As the gyro moved, an 18F measured the pitch
and roll angular differences and did the maths, the result of which was
the number of microsteps the motors had to move to keep a platform
horizontal. These numbers were sent to the SX, which used them in the
pulse timing loops. I wrote isochronous code which broke down into
fixed-cycle modules and everything meshed together very well with PIC-
SX handshakes, data being transferred into a buffer during loop time.
Even so, it was tight, with every SX cycle accounted for

2009\04\30@081706 by Nick F

picon face



Jan-Erik Soderholm wrote:
{Quote hidden}

Yes, sorry. I was thinking about the duration of a one cycle instruction.
The shortest pulse I can generate with a 20MHz clock has 200ns and by using
the following code, the period of a complete cycle has 800ns.

Loop        
       bsf        LEDPORT,        LED        ;turn on led for 200ns (1 cycle)
       bcf        LEDPORT,        LED        ;turn off led for a total of 600ns (3 cycles with goto)
       goto        Loop                        ;go back and do it again


If I want a 50% duty cycle, I can generate a 1.2us pulse using this method
(add two nop after bsf).
I know it is very crude, I try to improve the code.

Regards,
Nick




--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23315118.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@083752 by Jinx

face picon face
> many users are able to use maybe just 10% of the capability of a
> microcontroller, then go up and learn another bit, and so on.

That's true to some extent, but the 90% that you don't use doesn't
make the PIC go faster unfortunately. But I think at 20MHz a 16F
can do what you're asking if you use different methods for various
pulse-length ranges. That said, if these were pulse trains the 16F
would be too slow. Using your example, 600ns 50% with an 18F

loop
bsf led
nop
nop
bcf led
bra loop

Without in-code testing, you could escape from this with an interrupt

On the 18F you also have the 1-cycle BTG instruction

btg pin
bra $-2

2009\04\30@085239 by Isaac Marino Bavaresco

flavicon
face
Jinx escreveu:
> I can see that you could use several methods to get the pulse you want ;
>
> >From 1us up to a certain length
>
> bsf
> (X * nop)
> bcf
>
> >From there to another length, an 8-bit decrement
>
> bsf
> decfsz X
> bra $-1
> bcf
>
> After that I think you'll need to go to a 16-bit decrement. For example
> 200us is 1000 instruction cycles

Don't forget that you may insert several NOPs or goto $ + 1 before the
decfsz:

   bsf

   goto   $ + 1
   decfsz X,f
   goto   $ - 2

   bcf

I like this one:

   movlw   N
L: clrwdt
   addlw   -1
   btfss   STATUS,Z
   goto   L   ; Each loop takes 5 Tcy = 1us @ 20MHz

Longer time:

   movlw   N
L: clrwdt
   goto   $ + 1
   goto   $ + 1
   nop
   addlw   -1
   btfss   STATUS,Z
   goto   L   ; Each loop takes 10 Tcy = 2us @ 20MHz


Regards,

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2009\04\30@091326 by Jinx

face picon face
Nick, if you have the memory to spare, you might try a computed
GOTO into four pages of NOP with a BCF and exit at the end.
This would give you 200ns resolution

bsf led
goto or call into block

many many many nops
nop
nop
nop
nop
bcf led
goto or return

2009\04\30@091544 by Isaac Marino Bavaresco

flavicon
face
Nick_F escreveu:
> Yes, sorry. I was thinking about the duration of a one cycle instruction.
> The shortest pulse I can generate with a 20MHz clock has 200ns and by using
> the following code, the period of a complete cycle has 800ns.
>
> Loop        
>        bsf        LEDPORT,        LED        ;turn on led for 200ns (1 cycle)
>        bcf        LEDPORT,        LED        ;turn off led for a total of 600ns (3 cycles with goto)
>        goto        Loop                        ;go back and do it again
>
>
> If I want a 50% duty cycle, I can generate a 1.2us pulse using this method
> (add two nop after bsf).
> I know it is very crude, I try to improve the code.
>
> Regards,
> Nick
>  

You stated that your pulses need to have variable length in microsecond
steps, then you may need something like this:

   movf   tPulse1,w
L1:                                    ; Do the pulse
   bsf   LEDPORT,LED
   addlw   -1
   btfss   STATUS,Z
   goto   L1

   bcf   LEDPORT,LED

   movf   tDelay1,w
L2:                                    ; Wait the delay after the pulse
   bcf   LEDPORT,LED
   addlw   -1
   btfss   STATUS,Z
   goto   L2

   bcf   LEDPORT,LED


Regards,

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2009\04\30@092808 by olin piclist

face picon face
Nick_F wrote:
> I would like somebody with more experience than me to advise about the
> structure of the program.

Then you'll have to be more clear on what you are trying to make it do.
You've apparently got the beginnings of a idea in your head, now you need to
write up a spec.  This is so that other people understand what it's supposed
to do, and also so that you get some particulars down so you won't wonder
later how many uS you assumed this or that was when you wrote the other
section of code.

You also clearly need to learn how to write a spec and explain things to
others.  The most important thing is to keep in mind what others known and
don't know.  A requirement may be obvious to you, but nobody else will
assume that unless you tell them.  A good spec also explains that the gizmo
is supposed to do, but stays away from how it is to accomplish that.  If the
spec is written correctly, then it shouldn't matter how it happens as long
as it does.

> I intend to start a project that uses a LCD display (2x16, parallel
> data
> input), three switches for input, three digital outputs, that each
> generates
> a pulse with a specific width.

Mostly OK so far, assuming "each" refers to the three digital outputs.

> Pulse2 and pulse3 come after delay2 and delay3.

Duh.  You haven't defined pulse2, pulse3, delay2 or delay3.  We could
possibly guess that pulseX refers to a digital output instead of some input
pulse, but we have no idea what delayX is supposed to be.  Try to think a
little.

> I want to modify the delays

Delays from what event to what other event?

> from 1us to 200us, with a resolution of 1us, as well as the widths of
> pulse1, pulse2, pulse3.

After making a bunch of assumptions I shouldn't have to, I can probably
guess what you mean, at least as far as the pulse widths.  I still have no
idea what the delays are supposed to be from.

I would say this is one of the worst specs I've seen lately, but sadly that
is not true.

> For this operation, I think using three switches, as: "Select Next
> Parameter/Set Value", "Up", "Down".

Do you mean pushbuttons or some type of momentary switches for this?  Yes,
those are switches too, but one would not normally guess that a generic
"switch" has the momentary attribute.

> Should I use interrupts, timers, etc? ...

You're not ready for that yet.  First you have to clear your muddled
thoughts about what you really want this thing to do, then you have to
explain it clearly (which will also help clarify it in your own mind).  It
would also help to explain what the overall purpose of the device is.  Often
we can suggset totally different ways to solve the problem than the way you
imagine.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@092820 by Jinx

face picon face
> Should I use interrupts, timers, etc ?

BTW Nick, you should have a look at the PWM module, particularly
if you're wanting a pulse train

2009\04\30@093112 by olin piclist

face picon face
Jinx wrote:
>> By using a more modern PIC (maybe an low-end PIC18) you get more
>> "things" (like better timers, table-lookup and so on) to play with.
>
> An 18F would also at least double the maximum clock speed. Delays
> and pulses with 1us resolution is going to be a lot easier with a
> 40MHz clock than a 20MHz.

So why not start out with a dsPIC?  The OP did way too much hand waving, but
did mumble something about 1uS resolution.  If response times are also on
that order (he never said anything about response time), then that will be
tough even for a PIC 18.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@093531 by Nick F

picon face



Jinx-4 wrote:
{Quote hidden}

I understand, I can see the advantages. My application is not critical, I
can accept a resolution of 2us (or even up to 5us). I just thought 1us
should be easily achievable, but now I can see it may not be that easy.
And with the lack of knowledge I have, I can make a 20MHz PIC move like a
snail :) Fools can be very creative, in the wrong direction...

Regards,
Nick






--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23316435.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@095416 by Nick F

picon face



Isaac Marino Bavaresco wrote:
{Quote hidden}

Hi Isaac,

Thank you very much for the code. At the moment I am working on a similar
line.
If an instruction takes 200ns, by using this command: "movf   tPulse1,w", it
means w can only hold 255 (actually 256), and the maximum delay will be
about 5 times less (about 51us). Am I right?


Regards,
Nick

--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23316739.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@095918 by olin piclist

face picon face
Nick_F wrote:
> I will keep that in mind. I don't totally agree with this advice,
> using a more powerful microcontroller.

Someone that came here claiming to know little, did a poor job of stating
the requirements, and specifically asked for advice from experts is hardly
in a position to then complain they disagree with the received advice.  And
yes, Jinx is one of the experts here you specifically asked for advice from.

You have given no information that makes this bad advice.  You never said
what volume this thing will be produced in, so Jinx is free to assume it's a
one-off.  Being a one-off, all the cost is in development.  Whether the
microcontroller costs a extra $ or two is irrelevant.  You also said you
didn't know assembly and preferred C.  While you should learn the low level
details of whatever processor you use, whether you eventually use a high
level language or not, it will be easier to get away with a little less
knowledge of the low levels on the higher PICs.  Actually I'll go further
than Jinx and say you should be using a dsPIC.  You've certainly given no
information that would argue against that.

> As far as I know, a 20MHz PIC16F628A can have a resolution of 200nS,
> which is 5 times better than my desired 1us.

Yes, a 20MHz PIC can produce a pulse with a resolution of 200nS, but what
about response time?  You never said how quickly the output pulse must be
produced once the triggering event (whatever that is, you never said) is
detected.  Detecting one of a multiple possible trigger events can take some
cycles of jitter.

> At the moment I think a faster PIC
> would be required mostly to supplement poor programming skills.

Lol.  Look guys, another newbie that knows everything with the attitude to
match!

> At the moment I know very little,

Exactly.  So sit down, listen to the responses you are getting, and provide
more specific information before you piss off those you seek a favor from
and get dismissed as yet another arrogant newbie.

> so it would be even worse to learn something more complex.

You are making invalid assumptions here.  But since your telling us instead
of asking and have therefore made up your mind already, explaining the error
in your reasoning would be pointless.

> I have to find the maximum
> capability of this PIC before looking to a more powerful one.

Why is this a requirement?  It makes no sense.

> From what I noticed, this advice to use a better
> microcontroller is given too often

And you're in a position to make this judgement even though you "know very
little", and have "never used a timer, PWM, interrupts"  and have "plenty to
learn"!!?

You need to decide whether you really want to learn from others or just want
to preach.

> many users are able to use maybe just 10% of the capability of a
> microcontroller, then go up and learn another bit, and so on.

You know this how?  And it's relevance even if true is...?


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@100153 by olin piclist

face picon face
Jinx wrote:
> Yes it does, but you need at least 2 (possibly 3) cycles to make a
> pulse
>
> bsf ;set pin
> nop ;if read-modify-write is a problem, which it isn't for the 18F
> bcf ;clear pin

Actually in this case RMW isn't a issue since you're writing to the same
pin.  You can produce a 200nS pulse on a 20MHz PIC by successive BSF/BCF
instructions on the same pin.  The RMW issue will only effect other pins on
the same port.  That means you want to leave a cycle or two before and after
the BSF/BCF, but don't need one between them.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@100349 by Alan B. Pearce

face picon face
>> An 18F would also at least double the maximum clock speed. Delays
>> and pulses with 1us resolution is going to be a lot easier with a
>> 40MHz clock than a 20MHz.
>
>So why not start out with a dsPIC?

I don't know how many PWM outputs a DSPic has, but a 24FJ256GB110 family has
9, and I am in the middle of a project that is going to be using a number of
these in exactly the manner that the OP seems to be wanting to do.

2009\04\30@101611 by olin piclist

face picon face
Nick_F wrote:
> I can accept a resolution of 2us (or even up to 5us).
> I just thought 1us should be easily achievable,

The spec should describe what you need, which has nothing to do with what
you think a particular implementation can provide.  Instead of letting the
tail wag the dog, decide what you need this gizmo to do, then look around
for a solution once the requirements are clear.

Again, it would also help to explain what the purpose of the gizmo is.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@101749 by Isaac Marino Bavaresco

flavicon
face
Nick_F escreveu:
> Hi Isaac,
>
> The application is not critical at all. Even if I can't get a resolution of
> 1us, but 2us (anything up to 5us!) is still ok.
> The sequence of pulses is always the same: Pulse1 - Pulse2 - Pulse3. Pulse1
> has Width1, Pulse2 and Pulse3 have equal Width23. The delay between each
> pulse is constant.
> In the moment I press on the keys, to modify the parameters of the pulses,
> Pulse1 should stop in 0 or 1 (not sure which one at the moment). The other
> two pulses are not critical.
> Once I set the parameters, all three pulses should reappear.
>
> Regards,
> Nick
>  


So your application is a piece of cake even for a PIC16F.
I suggest you write your application in C and the pulse generating
routine in assembly.

No need to use interrupts or hardware such as CCP modules.

Make your routine an infinite loop and just return to the main program
when it detects a keypress.
You don't need to test for the keypress more than once each loop,
because your loop is very fast.

Just to clarify, what happens after Pulse3? Does it start over with Pulse1 ?

Regards,

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2009\04\30@102336 by Nick F

picon face



Olin Lathrop wrote:
{Quote hidden}

Hi Olin,
You are very right about everything you said. I will try to present a bit
better the specifications.
>From the details you require, it looks you want to complete all the project
for me :P

These three pulses are already generated on an electronic board by some
timers, like 555 and 4221. Rather than using at least three chips and a
bunch of pots, I want to use just a microcontroller, an LCD and some
momentary switches.

I will try to explain it in more details:

Each digital output is supposed to generate a pulse (Pulse1, Pulse2,
Pulse3), each with a specific width Width1, Width2, Width3.
In my particular case, Width2 = Width3.
Pulse1 will be first, pulse2 will always be later than Pulse1, Pulse3 will
always be later than Pulse2.
Between start of Pulse1 and start of Pulse2 will be a Delay1 (where Delay1 >
Width1), and between Pulse2 and Pulse3 will be a Delay2 (where Delay2 >
Width2).From the start of Pulse3 to the start of Pulse1, there will be a
Delay3 (Delay3 > Width3).

Width1 = 1...200us
Width2 = 1...200us
Width3 = 1...200us

Delay1 = Width1+1...Width1+200 (us)
Delay2 = Width2+1...Width2+200 (us)
Delay3 = Width3+1...Width3+500 (us)

The input swiches are indeed momentary switches (pushbuttons).
Next, about the part where I set the parameters. In the moment I start the
buttons, all the digital outputs should be set to 0. After setting the new
parameters, the pulses should reappear after any period of time, less than
1000ms.

If you still consider the specification is unclear, I will try to go into
some more details.

Regards,
Nick



--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23317228.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@102348 by olin piclist

face picon face
Nick_F wrote:
> If an instruction takes 200ns, by using this command: "movf
> tPulse1,w", it means w can only hold 255 (actually 256), and
> the maximum delay will be about 5 times less (about 51us).
> Am I right?

This is so confused it's hard to decide where to begin.  Let's try this one
piece at a time:

> If an instruction takes 200ns,

On a normal PIC 16 running at 20MHz, all instructions that don't modify the
PC in any way take 200nS.

> by using this command: "movf tPulse1,w"

I think you mean "instruction".  Yes, this instruction will take 200nS to
execute given the conditions described above.

> it means w can only hold 255 (actually 256)

W is a 8 bit register.  It can hold any 8 bit binary value.  If you
interpret that binary value as a unsinged integer, then it can hold from 0
to 255.  If you interpret it as a signed integer, then it can hold from -128
to +127.  In any case the statement that it can only hold 255 is wrong, as
it can hold 256 different values no matter how you interpret the binary
pattern.  Also since it would generally be wrong to interpret the W value as
anything other than a signed or unsigned integer without specific context to
the contrary, saying that it can hold 256 is wrong.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@103058 by Nick F

picon face



Olin Lathrop wrote:
>
> Jinx wrote:
> So why not start out with a dsPIC?  The OP did way too much hand waving,
> but
> did mumble something about 1uS resolution.  If response times are also on
> that order (he never said anything about response time), then that will be
> tough even for a PIC 18.
>

What is that OP?
And what would be the response time in this case?



--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23317300.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@104536 by Rikard Bosnjakovic

picon face
On Thu, Apr 30, 2009 at 16:30, Nick_F <.....NFIERARUKILLspamspam@spam@gmail.com> wrote:

> What is that OP?

OP = Original Post(er).


--
- Rikard - http://bos.hack.org/cv/

2009\04\30@104941 by Isaac Marino Bavaresco

flavicon
face
Nick_F escreveu:
{Quote hidden}

No, each loop execution takes exactly 5 cycles, or 1 microsecond, so
your maximum delay is 255 microseconds.

And I made a mistake, please remove the "bcf LEDPORT,LED" after the
"goto L1".


Regards,

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2009\04\30@105447 by Nick F

picon face



Olin Lathrop wrote:
{Quote hidden}

Oh, my god Olin,
I think your greatest pleasure in life is to criticize other people. I am
very much like yourself, we could be brothers :)
Nobody explained to me that I am not allowed to have (wrong) oppinions when
posting a reply. I don't say I am always right (in rare circumstances I
admit I may be wrong!)
All my assumptions are based on extrapolation of my little defects and
mistakes, so they must be accurate.

I like Jinx, he is a lot more friendlier than you are :)
At present I will still be using the PIC16F628A. My wife gets closer to kill
me for every $1 I spend on electronics. Not having a programmer for a more
advanced chip, not having strict requirements for the project, doesn't
justify for me the extra financial effort.
About the response time. The circuit doesn't receive any critical feedback.
The only time when I have to interrupt is when I want to change the
parameters, and I don't care about the response time, it could be many
milliseconds.

Regards,
Nick



--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23317874.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@105704 by olin piclist

face picon face
Nick_F wrote:
> Each digital output is supposed to generate a pulse (Pulse1, Pulse2,
> Pulse3),

Ah, so the three digital outputs each produce a single pulse in sequence.

> From the start of Pulse3 to the start of Pulse1, there will
> be a Delay3 (Delay3 > Width3).

But you said pulse1 will always be first, so how can you specify a delay
from pulse3 to pulse1?

{Quote hidden}

So these sets of three pulses are being constantly repeated at a 1Hz or
greater rate?


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@105723 by Nick F

picon face



Jinx-4 wrote:
>
>> Should I use interrupts, timers, etc ?
>
> BTW Nick, you should have a look at the PWM module, particularly
> if you're wanting a pulse train
>

Thanks Jinx, I was already looking at PWM and I think it could be good for
what I need.
Would the PWM be able to generate all three pulses?

Regards,
Nick

--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23318038.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@105920 by olin piclist

face picon face
Nick_F wrote:
> What is that OP?

Original Poster, a common abbreviation on email lists and web forums.

> And what would be the response time in this case?

Response time from input that indicated to produce a pulse to the pulse
being produced.  You hadn't said at that time that the pulses should be
continuously produced.

Again, what is the overall purpose of this device?


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@110219 by Nick F

picon face



Olin Lathrop wrote:
{Quote hidden}

> --

2009\04\30@111727 by Nick F

picon face


Isaac Marino Bavaresco wrote:
>
> No, each loop execution takes exactly 5 cycles, or 1 microsecond, so
> your maximum delay is 255 microseconds.
>
> And I made a mistake, please remove the "bcf LEDPORT,LED" after the
> "goto L1".
>

Oh, that is very nice. Thanks again for the piece of code.

Regards,
Nick
--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23318406.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@112550 by Nick F

picon face



Jinx-4 wrote:
{Quote hidden}

But how can I change the delays?
I can make a block of 1000 NOP's, but how can I generate any delay between
one NOP and 1000 NOPs? Should I place GOTO to the absolute address of either
of the NOPs, or each should have a distinct label?

Regards,
Nick


--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23318366.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@112735 by Nick F

picon face


Olin Lathrop wrote:
>
> W is a 8 bit register.  It can hold any 8 bit binary value.  If you
> interpret that binary value as a unsinged integer, then it can hold from 0
> to 255.  If you interpret it as a signed integer, then it can hold from
> -128
> to +127.  In any case the statement that it can only hold 255 is wrong, as
> it can hold 256 different values no matter how you interpret the binary
> pattern.  Also since it would generally be wrong to interpret the W value
> as
> anything other than a signed or unsigned integer without specific context
> to
> the contrary, saying that it can hold 256 is wrong.
>

Thanks Olin,

It is a useful explanation. What I wanted to say is that it can hold 256
distinct values.
In assembler, how can I specify I want to assign the value of W to an
unsigned or signed integer?

Regards,
Nick




--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23318572.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@112917 by Nick F

picon face



Olin Lathrop wrote:
>
>> And what would be the response time in this case?
>
> Response time from input that indicated to produce a pulse to the pulse
> being produced.  You hadn't said at that time that the pulses should be
> continuously produced.
>
> Again, what is the overall purpose of this device?
>
Hi Olin,

It is supposed to generate the control pulses for a Metal Detector. For more
details about it, you can check this link:
http://www.geotech1.com/cgi-bin/pages/common/index.pl?page=metdet&file=projects/hammerhead/index.dat

Regards,
Nick

--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23318624.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@113558 by Nick F

picon face


Olin Lathrop wrote:
{Quote hidden}

The delay would be from Pulse3 to the next Pulse1, because they are in
sequence.
The pulses are in succession and a complete cycle (formed by three pulses)
takes normally under 1ms (frequency of 1000Hz).
What I meant with the 1000ms delay is that after completing introduction of
the new parameters in the EEPROM, the normal generation of pulses should
happen within 1 second.

Regards,
Nick






--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23318793.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@115507 by olin piclist

face picon face
Nick_F wrote:
>> many many many nops
>> nop
>> nop
>> nop
>> nop
>> bcf led
>> goto or return
>
> But how can I change the delays?
> I can make a block of 1000 NOP's, but how can I generate any
> delay between one NOP and 1000 NOPs?

You don't need NOPs at all.  A simple timing loop:

   decfsz  dcount
   goto    $-1

has a resolution of 3 instructions or 600nS.  Since your maximum time is
200uS, it would be easier to arrange the delay loop so that a single 8 bit
count value can be used to cover all possible times.  That works in this
case if the delay loop takes 5 cycles:

loop
   nop
   nop
   decfsz  dcount
   goto    loop

In this case the resolution will be 1uS and the maximum delay is 256uS, so
it covers your spec.  You would insert one of these delay loops between each
of the edges that need careful timing.  You could use a separate delay count
for each of these delay loops so that they can all be pre-loaded.

This is a great application for a macro:

delayus macro dcount       ;delay the number of uS in DCOUNT
       local loop
loop
       nop
       nop
       decfsz dcount
       goto   loop
       endm

Now the code can look something like:

    bsf      out1_pin       ;start pulse 1
    delayus  pulse1t
    bcf      out1_pin       ;end pulse 1
    delayus  gap1t
    bsf      out2_pin       ;start pulse 2
    delayus  pulse2t
    ...

Of course you have to pay attention to banking.  In this special case you
can put the time delay values, like PULSE1T, GAP1T, etc in the same bank as
the port registers (bank 0 I think).  You can reload the time delay
variables after the sequence of three pulses is over.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@115724 by olin piclist

face picon face
Nick_F wrote:
> In assembler, how can I specify I want to assign the value of W to an
> unsigned or signed integer?

You don't.  You don't "assign" it to any data type.  The only difference is
in how you interpret the value.  The machine does the same twos complement
arithmetic on the binary pattern regardless of what you think it means.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@120345 by olin piclist

face picon face
Nick_F wrote:
> What I meant with the ...

Do you see a recurring pattern here?  If you're constantly having to explain
what you meant, then you need to say it better in the first place.  You are
being too sloppy with words and undefined terms.  This is not a good thing
when you're trying to do engineering.  Either learn to be more clear or find
something else to do.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\30@140152 by Bob Blick

face
flavicon
face
Hi Nick,

I've been reading this thread and having a hard time following all the
little pieces.

Is it possible to post the complete specs in one email? Because I don't
really know if these three pulses are continuously recurring, are
related to each other, etc. That would have a lot of effect on how the
code was created. What happens to the pulses while a key is in the
middle of being pressed, and vice-versa? etc etc.

Thanks,

Bob

Nick_F wrote:
{Quote hidden}

2009\04\30@180045 by Nick F

picon face



Olin Lathrop wrote:
>
>
> Of course you have to pay attention to banking.  In this special case you
> can put the time delay values, like PULSE1T, GAP1T, etc in the same bank
> as
> the port registers (bank 0 I think).  You can reload the time delay
> variables after the sequence of three pulses is over.
>
Thanks Olin, the code looks very clean and clear. I will try it tonight.

Regards,
Nick




--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23325103.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@180738 by Nick F

picon face



Olin Lathrop wrote:
{Quote hidden}

Yes, I have to admit you are right again.
I don't have very strong language skills.
I'm trying to improve.

Regards,
Nick
--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23325205.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@181828 by Nick F

picon face



Olin Lathrop wrote:
{Quote hidden}

When I was at the uni, a teacher was refering to us, the students. He said,
engineers are like dogs. We have an intelligent look on our faces and seem
to understand what we are told. We only can't express ourselves :)

Regards,
Nick

--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23325351.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@194451 by Jinx

face picon face
>> many many many nops
>> nop
>> nop
>> nop
>> nop
>> bcf led
>> goto or return
>>
> But how can I change the delays?

TBH Nick my suggestion is a bit of an 'adventurous' solution. It
would mean calculating the address that the code needs to jump
to (based on the length of the pulse required) and modifying the
program counter to do that jump. It could work but is fraught with
problems

2009\04\30@195525 by Jinx

face picon face
>> bsf ;set pin
>> nop ;if read-modify-write is a problem, which it isn't for the 18F
>> bcf ;clear pin

> That means you want to leave a cycle or two before and after
> the BSF/BCF, but don't need one between them.

Yes, that's fair enough. (The OP uses an LED in the example, although
I wonder what purpose there could be of a 1us pulse through an LED,
unless it's an opto perhaps). His later spec of the sequence of pulses
and their separation does make r-m-w problems less likely

2009\04\30@203721 by Nick F

picon face



Bob Blick-4 wrote:
{Quote hidden}

Hi Bob,

I will give one more go to the specifications for the project. I realised I
ommited important information in my previous descriptions.

Microcontroller: PIC16F628A or PIC16F648A with 20MHz clock.
Programming language: assembler or C or both.
Production scale: one-off or very limited.
Application of project: generating control pulses for a metal detector.

The main purpose of the microcontroller is to generate a cyclical succession
of three pulses (Pulse1-Pulse3-Pulse3-Pulse1-Pulse2-Pulse3-etc). Each pulse
has to be generated at a different digital output of the microcontroller.
The temporal order of pulses is always Pulse1, Pulse2, Pulse3. Each pulse
has to have a width of 1...200us (Width1, Width2, Width3). Between the start
of each pulse until the start of the next pulse, will be a delay (Delay1
between start of Pulse1 and start of Pulse2, Delay2 between start of Pulse2
and start of Pulse3, Delay3 between start of Pulse3 and start of Pulse1,
where Pulse1 is the pulse from the next cycle).
Delay1 is between (Width1+1)...200us. Delay2 is between (Width2+1)...200us.
Delay3 is between (Width3+1)...500us.
Pulse2 should start only after Pulse1 ended, Pulse3 should start only after
Pulse2 ended and ~next~ Pulse1 should start after Pulse3 ended.

The adjustable parameters are: Width1, Width2, Width3, Delay1, Delay2,
Delay3.
The resolution of these parameters should be ideally 200ns. If that can't be
accomplished, a very good resolution is 1us. If that resolution can't be
accomplished, an acceptable resolution is anything up to 5us.

During the generation of these pulses, the microcontroller has only one
other task to do: to monitor the pushbuttons, to find out if the user wants
to modify the parameters. It is enough to monitor just the status of one
pushbutton (which I called "Select Next/Set"). If the user presses this
button, the microcontroller should halt the generation of pulses in a known
state (let's say all digital outputs set to 0) and display on LCD the first
set of data: Pulse1 and Delay1.
At the first press of the Select Next/Set button, it should display on the
two rows of the LCD this information: Width1 = 42us, Delay1 = 54us.
(whatever is stored in EEprom). If I press Up or Down pushbuttons, the value
in Width1 should increment or decrement with the resolution steps. Then,
when I press Set again, it should store the new value for Width1 and allow
me to modify the value of Delay1. When I press Set again, it should display
Width2, Delay2 and allow me to edit these two values in a similar manner.
After a period of pushbuttons inactivity (2 seconds), the microcontroller
should restart the generation of pulses at the three digital outputs.

There are no other interrupts sent to the microcontroller, so there are no
requirements about fast response time.

The LCD I have is a standard 2x16 characters, with parallel input. As far as
I know, I can send commands either on 8 bits, either on 4 bits. Depending if
there are enough pins left at the microcontroller, I can send data on 8
bits. If not enough pins are left, I can use either 4 bits, or a serial to
parallel shift register to send the data to LCD.

I hope this time the specification is more clear. Olin, you may still find
bits and pieces that are not right, but I tried my best this time. If it
still won't be good enough, I will have to say goodbye to this cruel
world... :)

Regards,
Nick

--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23326874.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@213025 by Jinx

face picon face
Nick, I've had a quick read of the constructional article

http://www.geotech1.com/pages/metdet/projects/hammerhead/HHv1p5.pdf

and it's a lot clearer now

So, there's an astable 555 running at 900Hz - 2300Hz with adjustable
duty cycle. This pulse train drives two 74HC221 monostables, which
in turn each output a delayed pulse with adjustable pulse width

The short answer is that this can be done fairly easily with the 628
using code suggested so far. PWM will work to replicate the original
555 train but as the other two need to be done in s/w you might just
as well use s/w for all

In the schematic

http://www.geotech1.com/pages/metdet/projects/hammerhead/HHd1.pdf

the controls are analogue (pots). It won't be possible to emulate this
exactly using pushbuttons without some disruption to the output until the
new values come into effect but in this app I don't think that's too much
of a big deal. OTOH the pulse parameters will be more consistent and
precise with a digital generator

My thought would be to use B0 INT to break into the pulse train. Push
buttons would be diode-OR'd to generate an interrupt from any button
press, with each button also going to its own PIC input. These inputs can
be polled to determine which button caused the interrupt and which
parameter is changed

2009\04\30@213652 by cdb

flavicon
face


:: At the first press of the Select Next/Set button, it should
:: display on the
:: two rows of the LCD this information: Width1 = 42us, Delay1 = 54us.
:: (whatever is stored in EEprom)

Not trying to pick holes, but do you really need to save parameters to
EEPROM?  Or did you just mean the current variable contents are
manipulated?

I only ask, as saving and reading from EEPROM is an amount of extra
code and comes with some timing restrictions - not that that would be
a problem in your case as the output(s) is stopped whilst in the
button handling function.

Does this also mean that when you switch the unit on, it should
retrieve data from EEPROM or are you just going to start from a
default value and then the operator 'fine tunes'  from there?

Colin


--
cdb, colinspamKILLspambtech-online.co.uk on 1/05/2009

Web presence: http://www.btech-online.co.uk  

Hosted by:  http://www.1and1.co.uk/?k_id=7988359







2009\04\30@221800 by Isaac Marino Bavaresco

flavicon
face
Jinx escreveu:
{Quote hidden}

I didn't studied the circuit, but perhaps the interval between pulse
sequences (between Pulse3 and next Pulse1) is not critical.

If so, the code may test for keypresses only once each loop. If no key
is pressed, it immediately starts the next sequence and no disturbance
is seen in the pulses.

If a key is pressed, the interface routine is called and treats this
keypress and returns immediately to the pulse generating routine. This
way a small extra delay is added between two pulse sequences only when a
key is pressed, and its results are seen immediately also.

> My thought would be to use B0 INT to break into the pulse train. Push
> buttons would be diode-OR'd to generate an interrupt from any button
> press, with each button also going to its own PIC input. These inputs can
> be polled to determine which button caused the interrupt and which
> parameter is changed
>  
A more intuitive interface would be having three rotary buttons with
quadrature encoders, or just one rotary button and one push-button for
selecting which value is being changed.


Regards,

Isaac.

>  
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2009\04\30@223718 by Nick F

picon face



CDB-3 wrote:
{Quote hidden}

Hi Colin,

I call parameters the values for pulse widths and delays for these three
pulses. The role of storing these values in EEprom is to be able to start
the device with the latest settings saved and not some default values. As
you said, at startup the program should read the values from EEprom.

Regards,
Nick




--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23327691.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\04\30@230233 by Jinx

face picon face
> I didn't studied the circuit, but perhaps the interval between pulse
> sequences (between Pulse3 and next Pulse1) is not critical.
>
> If so, the code may test for keypresses only once each loop. If no key
> is pressed, it immediately starts the next sequence and no disturbance
> is seen in the pulses

I think that's true in this case because the frequency is quite low

> If a key is pressed, the interface routine is called and treats this
> keypress and returns immediately to the pulse generating routine. This
> way a small extra delay is added between two pulse sequences only
> when a key is pressed, and its results are seen immediately also

Overall, one slightly longer pulse gap won't make a noticeable or
important difference for a metal detector. One other consideration
would be debouncing the press/release with an input RC filter and
button time-out, as noise would span many cycles.


2009\04\30@231057 by cdb

flavicon
face


:: at startup the program should read the values from EEprom.

If you are doing this in 'C', then that bit will be easy as more than
likely your compiler provider has a some read and write EEPROM
functions already nutted out - though you can in most cases just cut
and paste the demo assembler code provided by Microchip in their Mid
Range manual if using assembler.

Colin
--
cdb, .....colinKILLspamspam.....btech-online.co.uk on 1/05/2009

Web presence: http://www.btech-online.co.uk  

Hosted by:  http://www.1and1.co.uk/?k_id=7988359







2009\04\30@232651 by Nick F

picon face



Jinx-4 wrote:
{Quote hidden}

Hi Jinx,

I am not trying to emulate exactly the operation of that detector. I feel
free to come to my own decisions about what I need and how I can do it.

I think it is better to use just one button for the interrupt, because it
reduces the chance of bumping into pushbuttons and stopping the generation
of pulses accidentally.

At the moment I don't see an advantage of being able to edit the parameters
(widths, delays) with minimal effects to the pulses, so if they just stop,
it would be ok. There is another matter, which I didn't mention and that is
the mosfet transistor that drives the coil must remain turned off while
editing the parameters, otherwise it would blow out. This is just a detail,
I should be able to take care of that in the code.

Regards,
Nick





--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23327913.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.


'[PIC] Project with LCD, keys and delays on PIC16F6'
2009\05\01@074243 by olin piclist
face picon face
Nick_F wrote:
> When I was at the uni, a teacher was refering to us, the students. He
> said,
> engineers are like dogs. We have an intelligent look on our faces and
> seem
> to understand what we are told. We only can't express ourselves :)

That's a lame excuse.  Expressing yourself is part of the job.  Just like
the rest of engineering, attention to detail and checking your work is
important, especially when you are the one asking things from others.  I'm
not talking about nuances of english grammar and spelling, but the logical
presentation order of ideas keeping in mind what has been defined already
and what not, and use of the correct words.  Anybody can get these things
right, so not getting them right only shows you don't care enough to bother.
If you can't be bothered to care about your project, why should anyone else?

Expressing ideas in words sloppily is just another symptom of the same
problem that causes people to draw sloppy schematics or write undocumented
and messy code.  It's all about lack of attention and no patience for
details.  Whether you like it or not, people will - and should - judge you
by your words and other work products like schematics and code.  It's a very
quick and remarkably effective way to distinguish those that are unsuitable
for engineering.  In nearly 30 years of doing this professionally, I have
yet to see a really good engineer that was sloppy with the details.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\01@083856 by Nick F

picon face



Olin Lathrop wrote:
{Quote hidden}

Hi Olin,

Despite the way your messages make me feel, I have to agree with you.
You are right, but you are a bitter person. Something like a medicine.
Hopefully your advice will sink in a bit.
I know my limitations, I am indeed sloppy, but I've seen worse than myself.
I asked for some general ideas with the coding and I purposely didn't put
all the details in.
I've seen young people asking for advice for some detailed tasks and they
got the reply "you don't expect us to do the coding for yourself". I didn't
want to get the same kind of answer, unfortunately I got worse.

What I said before it was supposed to be a joke and yet, you attacked me
again.
I could also ask you, Olin, how long ago did you lose your sense of humour?

Regards,
Nicolae




--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23332495.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\05\01@084030 by Nick F

picon face


Olin Lathrop wrote:
{Quote hidden}

Hi Olin,

Despite the way your messages make me feel, I have to agree with you.
You are right, but you are a bitter person. Something like a medicine.
Hopefully your advice will sink in a bit.
I know my limitations, I am indeed sloppy, but I've seen worse than myself.
I asked for some general ideas with the coding and I purposely didn't put
all the details in.
I've seen young people asking for advice for some detailed tasks and they
got the reply "you don't expect us to do the coding for yourself". I didn't
want to get the same kind of answer, unfortunately I got worse.

What I said before it was supposed to be a joke and yet, you attacked me
again.
I could also ask you, Olin, how long ago did you lose your sense of humour?

Regards,
Nick




--
View this message in context: www.nabble.com/Project-with-LCD%2C-keys-and-delays-on-PIC16F628A-tp23309866p23332495.html
Sent from the PIC - [PIC] mailing list archive at Nabble.com.

2009\05\01@093425 by olin piclist

face picon face
Nick_F wrote:
> Despite the way your messages make me feel, I have to agree with you.
> You are right, but you are a bitter person. Something like a medicine.
>
> ...
>
> I could also ask you, Olin, how long ago did you lose your sense of
> humour?

Oh get over it.  You haven't been singled out.  Sloppy code, schematics, and
specs need to be stomped on hard and quickly when they occur.  You don't
want someone getting away with that kind of arrogance, and you want to have
all the wannabe slobs think twice.  If you don't like it, be more careful.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\01@113732 by Bob Blick

face
flavicon
face
Olin, stop being a troll.

Nick, stop feeding him.

Thanks,

Bob


On Fri, 1 May 2009 09:36:27 -0400, "Olin Lathrop"
<EraseMEolin_piclistspam_OUTspamTakeThisOuTembedinc.com> said:
{Quote hidden}

--
http://www.fastmail.fm - Does exactly what it says on the tin

2009\05\01@123235 by Dave Tweed

face
flavicon
face
Olin Lathrop wrote:
> Nick_F wrote:
> > When I was at the uni, a teacher was refering to us, the students.
> > He said, engineers are like dogs. We have an intelligent look on our
> > faces and seem to understand what we are told. We only can't express
> > ourselves :)
>
> That's a lame excuse. Expressing yourself is part of the job.

In fact it *is* the job. The only end product of any engineering process
that matters is the documentation (including source code and hardware
diagrams). It's amazing how many "engineers" lose sight of that fact.
Activities such as building prototypes, debugging, etc. are simply an aid
to producing good documentation.

If someone else can't easily produce, apply and/or maintain the product in
question based on your documentation, then you've failed as an engineer.

-- Dave Tweed

2009\05\01@130844 by Bob Blick

face
flavicon
face
On Fri,  1 May 2009 12:32:33 -0400 (EDT), "Dave Tweed" <picspamspam_OUTdtweed.com>
said:

> If someone else can't easily produce, apply and/or maintain the product
> in
> question based on your documentation, then you've failed as an engineer.

Dave,

Perhaps you hadn't noticed that Nick was trying to politely calm Olin
down.

He showed he could apply nuance skillfully, although his antagonist was
dug in for a good fight.

It would be nice if everyone would lighten up a bit.

Cheerful regards,

Bob

--
http://www.fastmail.fm - Faster than the air-speed velocity of an
                         unladen european swallow

2009\05\02@061434 by Vitaliy

flavicon
face
Dave Tweed wrote:
>> > When I was at the uni, a teacher was refering to us, the students.
>> > He said, engineers are like dogs. We have an intelligent look on our
>> > faces and seem to understand what we are told. We only can't express
>> > ourselves :)
>>
>> That's a lame excuse. Expressing yourself is part of the job.
>
> In fact it *is* the job. The only end product of any engineering process
> that matters is the documentation (including source code and hardware
> diagrams). It's amazing how many "engineers" lose sight of that fact.
> Activities such as building prototypes, debugging, etc. are simply an aid
> to producing good documentation.
>
> If someone else can't easily produce, apply and/or maintain the product in
> question based on your documentation, then you've failed as an engineer.

Dave -- if you were right, I would agree with you. :)

The only end product that matters, is the end product.

I don't think I've ever heard anybody refer to source code as
"documentation".

Vitaliy

2009\05\02@085230 by Dave Tweed

face
flavicon
face
Vitaliy wrote:
> Dave Tweed wrote:
> > Olin wrote:
> > > That's a lame excuse. Expressing yourself is part of the job.
> >
> > In fact it *is* the job. The only end product of any engineering process
> > that matters is the documentation (including source code and hardware
> > diagrams). It's amazing how many "engineers" lose sight of that fact.
> > Activities such as building prototypes, debugging, etc. are simply an
> > aid to producing good documentation.
> >
> > If someone else can't easily produce, apply and/or maintain the product
> > in question based on your documentation, then you've failed as an
> > engineer.
>
> Dave -- if you were right, I would agree with you. :)
>
> The only end product that matters, is the end product.

Of course it is, and that was my point! The engineer does not produce the
end product himself; he needs to be able to tell others how to produce
(and use) the end product.

He needs to do it clearly and completely; otherwise, manufacturing costs
may be higher than necessary, yield and reliability may be lower, and
end-user satisfaction may suffer.

> I don't think I've ever heard anybody refer to source code as
> "documentation".

Well, it doesn't end up in the end product, any more than the schematic
diagrams do. Source code is simply instructions to a compiler (or assembler
or HDL synthesis tool) to get it to produce the bits that actually do go
into the end product. Furthermore, this source code needs to be read or
modified from time to time, and not necessarily by the engineer who wrote
it. Therefore, it has to have the same readability attributes as all the
other forms of documentation.

In the sense that everything the engineer produces can be written on sheets
of paper, it is documentation.

Now, let's get back to the OP's problem, which related to the functional
specfication of what he wanted to do. Normally, the functional spec is
the input to the engineering process, written by somebody else. However,
in practice, I have found that non-engineers write terrible functional
specs, and that it works much better if the engineer writes them and then
gets the other parties to review them and eventually "sign off" on them.
The engineer knows from experience what kinds of things he needs to see in
a functional spec, and therefore should be able to write a good one. And
that's what kicked off this whole discussion -- we got a bad functional
spec, and we tried to help the OP write a better one. Once we have that,
we can begin the creative (fun) side of engineering: "Making what you want
from what you can get."

-- Dave Tweed

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...