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.

Using WG12864B instead of 12864-F.. How ?

Status
Not open for further replies.
Did quite a bit last night, didn't get to bed until 12.30. I got the screen double buffered, and managed 30fps with a simple line from left to right.. I need to do the text now and then the scope logic..

Ian
 
Did some more last night.. Got the text working and most of the scope logic... I may have gone a tiny bit overboard as I have tried it with sine, sawtooth, triangle and square wave all worked very well but the screen update gets a tad slow when you reach 7khz. I've included at this point a vertical position pot, a switch for the on screen text, a switch to change ADC rate. I think I need a trigger as the wave doesn't appear to stay in one place (well duh). peak to peak voltage should be relatively easy then it will just be the frequency readout..

Ian
 
Great work Ian.. Congrats.
Code:
a switch to change ADC rate.
We can use three pole sw. for changing the rate to X10, X100, X1000. Possible ??
 
I've tested and tested this routine until I'm blue in the face... I hope someone else reading / following this thread ( Eric / Nigel ? ) can put a few thoughts in..

To read the ADC 128 times with a TAD of 2 (smallest) and a FOSC of a minimum of 16 ( starts to throw errors at 20 meg ) I get 4.4ms to read the full screen. To physically display this frequency I have a maximum of frequency of 32 waves (I need at least 4 pixels to show the basic square wave )... around 6khz.

How the hell did John Becker display 16khz!! to do this I need to get the 128 samples done in 2ms !!!!!!

Any comments?

Ian

I've re-written the ADC routine slightly and now I get 3.5ms ...9.1khz ( getting better )
 
Last edited:
I think there's a little bit of time pinching going on there... If I compile the original program and run it in ISIS there are hundreds of warnings about ADC timing issues..
When you look into sampling, we are told at uni that you need to sample at least twice the frequency. So..to display the most basic square wave, I need four samples
. .
ie . . This will generate a square wave and is the minimum samples required for the display routine.

This is a 32nd of 128 4.4ms / 32 = 7.3khz .

Ian

Oh by the way Solidus do you want to see the project I can post the schematics and project.. You can use the code for other projects.
 
Last edited:
Nice job. Congrats Ian.. Is it possible to build this circuit with 16f877-20p ? And how about the frequencies over 8 KHz ? At least, we should use it at audio frequency limits.. Am I right ?
 
No! The reason for this is that the KS0108 doesn't have the luxury of text and has to be created, The code at the moment only does up to 7khz and audio can be up to 22khz.. I am working on it.

To get it faster we'll have to set the ADC read cycle to 4OSC but that will not read the ADC properly but will give enough samples.. I need to optimise the setpixel routine as if there are too many vertical lines the display slows to a snails pace..

I have double buffered the screen (this need mre memory than the pic16f877a) but as I said the pic18F is a drop in replacement.

Ian
 
hi Ian,
Managed to read the original asm from that Turkish link, nothing else.??

Whats the maximum frequency the author is claiming that be sampled and displayed.??
 
Hi Eric It was "John Becker" from EPE magazine... He reckons 17khz! that means his samples have to be around 64khz (it works out 128 samples in 2ms )

The only way I can do that is by undersampling @ 20mhz 16 OSC cycles is the minimum.. To get this I need to do 4 OSC cycles.

Ian
 
Hi Eric It was "John Becker" from EPE magazine... He reckons 17khz! that means his samples have to be around 64khz (it works out 128 samples in 2ms )

The only way I can do that is by undersampling @ 20mhz 16 OSC cycles is the minimum.. To get this I need to do 4 OSC cycles.

Ian

hi Ian,
I have been following this thread.
How many sample points in a 17Khz sine wave, does he say.?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top