Searching \ for ' [PIC] Re: instructions' 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: 'Re: instructions'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC] Re: instructions'
2000\06\18@193603 by Tony Nixon

flavicon
picon face
Hi all,

Thanks for the responses.

I did make a typo - sorry.

The data I need is from 0x40 to 0x7F.

I had to stick with..

WaveData bsf FSR,6
        movf INDF,W
        incf FSR
        movwf PORTB
        bcf FSR,7
        goto WaveData7

I thought about doing this in ROM which, as Scott mentioned, will result
in 4 cycles, but the user is likely to change things quite a bit and the
ROM will probably fail too quickly.

I can get to about 11KHz when using 20MHz, and considering it's only
hobby stuff, it may be good enough.

This stuff is available for download now at

/http://www.picnpoke.com/demo/ROMzap.html

Michael Rigby-Jones wrote:

> > the problems I had with quick succession BSF BCF instructions I had to
> > do the following...
> >
> Did you try more than one PIC/is this repeatable?

I'll play around with it again today if I have time.



--
Best regards

Tony

http://www.picnpoke.com
spam_OUTsalesTakeThisOuTspampicnpoke.com

2000\06\18@213438 by Scott Dattalo

face
flavicon
face
On Mon, 19 Jun 2000, Tony Nixon wrote:

{Quote hidden}

No, I said 4 cycles while reading from RAM. The ROM part your thinking about is
that the loop is unrolled such that indirect addressing can be avoided.
Consequently, the code looks rather large. Also, I notice that the loop you show
above has no means of exiting. If you can live with this, then it's possible to
read the values from RAM and update the samples once every 3 cycles. (It's easy
enough to break out of the loop if you have the interrupt-on-change interrupt
enabled. When the interrupt is processed, you exit with a goto instead of a
return. Take a second look at what I (and also Nikolai) posted the other day.

Scott

2000\06\18@215748 by Tony Nixon

flavicon
picon face
Scott Dattalo wrote:

> No, I said 4 cycles while reading from RAM. The ROM part your thinking about is
> that the loop is unrolled such that indirect addressing can be avoided.
> Consequently, the code looks rather large. Also, I notice that the loop you show
> above has no means of exiting. If you can live with this, then it's possible to
> read the values from RAM and update the samples once every 3 cycles. (It's easy
> enough to break out of the loop if you have the interrupt-on-change interrupt
> enabled. When the interrupt is processed, you exit with a goto instead of a
> return. Take a second look at what I (and also Nikolai) posted the other day.
>
> Scott

Hi Scott,

I never though about a frequency generator on the PIC's clock - Cool
idea.

I can vary the frequency by using a scaler value 7 - 255. It's a bit
rough, but I'm not building something for Hewlett Packard :-)

How do you read from RAM in 3 cycles? I thought 4 minimum to keep data
evenly spaced.

Loop
 movf RAM1,W
 movwf PORTB
 goto $ + 1
 movf RAM2,W
 movwf PORTB
 goto Loop

I actually implemented an IRQ on USART receive so that I can stop the
wave when the PC sends a char.


--
Best regards

Tony

http://www.picnpoke.com
.....salesKILLspamspam@spam@picnpoke.com

2000\06\18@221449 by Scott Dattalo

face
flavicon
face
On Mon, 19 Jun 2000, Tony Nixon wrote:

> I never though about a frequency generator on the PIC's clock - Cool
> idea.

It works great!


>
> How do you read from RAM in 3 cycles? I thought 4 minimum to keep data
> evenly spaced.

woops, a thinko on my part. What you show below is correct

{Quote hidden}

That'll do it.

Scott

2000\06\19@010900 by Tony Nixon
flavicon
picon face
Scott Dattalo wrote:

> woops, a thinko on my part. What you show below is correct
>
> >
> > Loop
> >   movf RAM1,W
> >   movwf PORTB
> >   goto $ + 1
> >   movf RAM2,W
> >   movwf PORTB
> >   goto Loop

No worries.

On implementation, it took 2K of ROM to be able to be able increment the
sample time by 1 cycle, with a range of 4 cycles to 255 cycles.

By math and on the CRO I get 61Hz - 3.9KHz @ 4MHz, and 306Hz - 19.5KHz @
20MHz with a 64 sample wave.

The PIC can now generate sine, sawtooth, rectified, triangle, a
capacitor charge/discharge, and a user defined arbitrary all with a
sweep function and inversion in X and Y.

--
Best regards

Tony

http://www.picnpoke.com
salesspamKILLspampicnpoke.com

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