Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

VDD on PICs

Status
Not open for further replies.
It is poorly worded. I think the author is just saying don't omit the seemingly vanishing, tiny capacitors.

Myself, I was talking about the number of tiny capacitors per power pin.

I've always found a 0.1uF perfectly fine, and to be fair they work quite happily without any capacitor at all - but 'sprinkling' a few 0.1uF's round makes me happy :D
 
I've always found a 0.1uF perfectly fine, and to be fair they work quite happily without any capacitor at all - but 'sprinkling' a few 0.1uF's round makes me happy :D
I tend to use 10 nF, which seem fine. For ICs with multiple pairs of power pins, I always use a decoupling capacitor for each pair.

On a veroboard circuit, where I had omitted the decoupling capacitor, the code ran fine until I had three program counter jumps, two returns and a goto, that were executed one after the other. That would crash the processor. Adding nops between them would cure it, as would fitting a decoupling capacitor.

It's always best to have good decoupling.
 
I tend to use 10 nF, which seem fine. For ICs with multiple pairs of power pins, I always use a decoupling capacitor for each pair.

On a veroboard circuit, where I had omitted the decoupling capacitor, the code ran fine until I had three program counter jumps, two returns and a goto, that were executed one after the other. That would crash the processor. Adding nops between them would cure it, as would fitting a decoupling capacitor.

It's always best to have good decoupling.
Hi D,
Sounds like the olympics:)

What are nops.
C.
 
Hi D,
Sounds like the olympics:)

What are nops.
C.
nop is the acronym for No Operation. I would guess that the plural "nops" is rare. I pronounce it "no op" or "no ops" in the plural. A nop is a PIC assembler instruction that does nothing. "return" and "goto" are also PIC assembler instructions.

Adding nops, or lines that do nothing, should not affect the program flow at all, so the fact that it did showed that something odd was happening
 
nop is the acronym for No Operation. I would guess that the plural "nops" is rare.

I wouldn't say so, nops is a perfectly normal term in programming. I've certainly never seen it referred to as 'no op' or 'no ops' :D

However, as for the actual point they were mentioned in, it's not clear EXACTLY what he was doing, and why adding nops or decoupling cured it?, I suspect he was doing something 'unusual', such as abusing the 'read, modify, write' requirements (which are commonly cured by a nop or two).
 
Hi D and N,
Ok, thanks.

I'm stuck in the world of BASIC, and with help I proceed slowly.

Sometimes I have to add a short wait in a program, which is perhaps what 'nops' is doing?

C.
 
I wouldn't say so, nops is a perfectly normal term in programming. I've certainly never seen it referred to as 'no op' or 'no ops' :D

However, as for the actual point they were mentioned in, it's not clear EXACTLY what he was doing, and why adding nops or decoupling cured it?, I suspect he was doing something 'unusual', such as abusing the 'read, modify, write' requirements (which are commonly cured by a nop or two).

'no op' or 'no ops' was the pronunciation, not the normal way of spelling.

It wasn't a read-modify-write issue.

What was happening in my code was something like this:
Code:
main_loop:

call routine_a
call routine_b
goto main_loop  //3

routine_a:
{some code}
return

routine_b:
{some code}
call routine_c
return   //2

routine_c:
{some code}
return     // 1

At the end of routine_b, routine_c is called. At the end of routine_c, marked //1, the program returns to the end of routine_b. Straight after that, at line marked //2, the return makes the program go to the end of main_loop, marked //3, which the jumps to the start.

So the three lines, //1, //2 and //3 are all program counter jumps, and happen one after the other. I suspect that the PIC takes more current when executing those than when executing other operations.

When I added a NOP before //2 or //3, the code ran fine. I guess the extra time allowed the power supply to recover.

Adding the correct capacitors meant that the code ran fine as written.
 
'no op' or 'no ops' was the pronunciation, not the normal way of spelling.

As I meant before, I've never heard of anyone pronouncing it that way - apart from you in this thread :D

Same for any other mnemonic, the whole point is it's a short cut - do you de-construct all the instruction mnemonics?.
 
such as abusing the 'read, modify, write' requirements (which are commonly cured by a nop or two)
You can't fix R-M-W with a nop.

RMW typically refers to the way a bit operation instruction is executed. It reads the byte, modifies the bit, and then writes the byte.
Since it's done in a single instruction you can't add a NOP to "fix" it.
 
As I meant before, I've never heard of anyone pronouncing it that way - apart from you in this thread :D

Same for any other mnemonic, the whole point is it's a short cut - do you de-construct all the instruction mnemonics?.

Most of my programming has been on my own, so I learned of most mnemonics from paper or screen, and I've only heard a few spoken.

I do think of most assembly instructions as the full deconstructed mnemonic, so for me BTSC is Bit Test & Skip if Clear, which helps me work out what it does. I suppose that the fact that several are words or shortened words, like Return, Goto or Bra(ch) has meant that I've thought of most of them as the full name. However, I've got to know some as the shorter version. For instance I don't think of ZE, as the full "Zero Extend".

Mnemonics often get better know than what they stand for. PIN, EEPROM and Fiat are good examples.
 
Hi D and N,
Ok, thanks.

I'm stuck in the world of BASIC, and with help I proceed slowly.

Sometimes I have to add a short wait in a program, which is perhaps what 'nops' is doing?

C.
NOP takes one instruction cycle.
For example with 4MHz clock it is 1us
 
In my younger days, Fiat stood for Fix It Again Tomorrow

FORD - Fix Or Repair Daily

To be fair I have owned two Ford cars and both were quite good, but not fautless.

JimB
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top