Searching \ for '[PIC]: A wierd emulator problem...' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'A wierd emulator problem...'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: A wierd emulator problem...'
2007\02\24@141154 by Mike Harrison

flavicon
face
OK here's a fun one for all you ICE2000 users....

Debugging a 16F818 based RFID reader. Very simple hardware - using the PWM peripheral to generate
125KHz carrier, and a moderate gain (about 10) amplifier + data slicer to demodulate the data.

All was going fine, until at an apparently arbitary time, the amplifier output started producing a
spike  for no apparent reason, but in a very consistent place time-wise.

Twiddling some delays in the code showed that the spike coincided with when the code execution
reached a certain routine.
Now the wierd part is that this routine was doing NO output of any kind, just polling for input
edges.

So how did the amplifier 'know' that the code had got to where it had...?

There was a definite consistent correlation between when the amp spiked and when the code reached a
certain place. Scoping the pins showed no obvious PIC pins changing immediately prior to the amp
playing up.

Tried a real chip, which worked fine.

I just figured it out after several hours intense head-scratching -  before I reveal what it was, I
wonder if anyone else can  guess what was causing it...?

Just to give a slight clue, it was not a software problem, and not the RFID coil picking up
anything.

 




2007\02\25@015939 by Richard Prosser

picon face
Power supply decoupling seems too obvious to suggest.
RP

On 25/02/07, Mike Harrison <spam_OUTmikeTakeThisOuTspamwhitewing.co.uk> wrote:
{Quote hidden}

> -

2007\02\25@062516 by Peter P.

picon face
Mike Harrison <mike <at> whitewing.co.uk> writes:

> I just figured it out after several hours intense head-scratching -  before I
> reveal what it was, I
> wonder if anyone else can  guess what was causing it...?

Read-modify-write due to ICD pins ?
Computer-produced specific electronic noise when simulating that code copling
into circuit ?

Peter P.


2007\02\25@072136 by Mike Harrison

flavicon
face
On Sun, 25 Feb 2007 11:24:39 +0000 (UTC), you wrote:

>Mike Harrison <mike <at> whitewing.co.uk> writes:
>
>> I just figured it out after several hours intense head-scratching -  before I
>> reveal what it was, I
>> wonder if anyone else can  guess what was causing it...?
>
>Read-modify-write due to ICD pins ?
>Computer-produced specific electronic noise when simulating that code copling
>into circuit ?

Almost there with the last one...

I needed to run at 3.3v, and so had to use the ICE2000  'power from target' option.
The amp was fairly sensitive to steps in the power supply due to using a resistive divder to
establish a mid-supply reference, and there wasn't much capacitance on the rails (there are reasons
for both of these, and is not a problem normally as it is battery powered and nothing else happens
during a read).

The emulator was taking a small but very fast current spike when the code reached the 'problem'
area. Still not sure why it did it at that particular point - wasn't at anything like an address
where a lot of address bits would have been changing. The only obvious thing is it was accessing
timer 1 - as the ICE2000 header has a 'T1 Osc' link, I suspect timer 1 may be implemented in ( or at
least somehow connected to )  one of the chips on the header, which might explain the sudden current
spike.

Applying an external 3.3v supply to the emulator power pin fixed it instantly...
 

2007\02\26@054231 by Alan B. Pearce

face picon face
>I just figured it out after several hours intense head-scratching
> -  before I reveal what it was, I wonder if anyone else can
>guess what was causing it...?
>
>Just to give a slight clue, it was not a software problem,
>and not the RFID coil picking up anything.

Reading the port containing the PWM output did strange things? I remember
having strange things happen on an I2C port when doing RMW things on the
port, then found that having the MSSP on did not lock out those bits from
modification.

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