Hello to the EEVblog Forum and a little Christmas season oscilloscope image - Page 1
Forum section: electronics / beginners

author: Redcat
author_rank: Regular Contributor
timestamp: December 12, 2013, 12:41:28 am
content: Just wanted to say hello to the EEVblog Forum.I'm new here (but following Dave's videos for long time now).My work is not really electronic related, but sometimes have to fix some serious electronic problems in our lab machines :-).So there are a lot of questions in my mind and I'm willing to learn from you.Sorry if my english is not the best, I can understand most of it but have not had so much practice in writing or speaking in the last years.Only some days to Christmas (really count the days-there is so much to do at work) and I stumbled on some interesting oscilloscope stuff at the weekend.Had to try it myself and here is the result (I hope you can see the image I attach).Yes, perhaps the worst Christmas tree you've ever seen.If somebody is interested, here is the link i found (might be, some of you know already):http://www.johngineer.com/blog/?p=648I had to write a little editor in Delphi to make all the coordinates of the image for the arduino code. If someone is interested, I will put it on my website somewhere on the next weekend so you can download it there (it's very basic but ok for me).EDIT: And here is the editor. Just uploaded it to my webspace if someone wants it:I have updated it now for use with PWM (8 bit values) or R2R network (6 bit values).http://www.redcatimaging.de/wp-content/uploads/2013/t1/XYosciCoord6u8bit.exeNice greetings, Tom

author: GreyWoolfe
author_rank: Unknown
timestamp: December 12, 2013, 03:38:45 am
content: and a nice greeting to you from a fellow Tom. MERRY CHRISTMAS!

author: Stonent
author_rank: Super Contributor
timestamp: December 12, 2013, 03:57:54 am
content: Frohe Weihnachten!

author: prenato
author_rank: Regular Contributor
timestamp: December 12, 2013, 06:41:33 am
content: Very nice!

author: calexanian
author_rank: Super Contributor
timestamp: December 12, 2013, 06:58:16 am
content: That will put the peppermint stick in your Roy Rodgers! ho ho humbug.... hahahahaha

author: Redcat
author_rank: Regular Contributor
timestamp: December 12, 2013, 07:14:57 pm
content: Thank you all that you like it.

author: w2aew
author_rank: Super Contributor
timestamp: December 13, 2013, 02:20:48 am
content: Love it! Thanks especially for the handy code to make the XY coordinates. I've done a few variations of these type of XY drawings on a scope, and I've typically resorted to tedious graph paper and manual compilation of the coordinates.Johngineer's original Tree was done on a scope that used to live in my basement - and I was very happy to see that the XY tree is one of the first things he did with it. Nice bit of trick in his code to speed up the PWM clock to minimize flickering in the image.If interested, here's my video that gives a little tutorial, starting with what John put together, then showing a different XY pattern.I also did a few sketches where I outputted the XY coordinates in parallel to the digital I/O pins, and used an R2R DAC to convert to analog. This is a LOT faster than than filtering the PWM outputs, which allows you to do more complex images with little flicker. My video on the R2R DAC shows the result of using the parallel digital output instead of the PWM (skip ahead to about 11:20 in the video to bypass the R2R DAC tutorial, or skip ahead to about 15:00 to jump right to the XY output).

author: Redcat
author_rank: Regular Contributor
timestamp: December 13, 2013, 06:46:51 pm
content: Hi w2aewactually exactly your video (have watched most of them and some days ago I watched a video with you explainig oscilloscopes to radio amateurs, sorry that I forgot your name) was the reason that I tried it and that I found the johngineer website.You did show it very good as every timeand on johngineers website was this nice arduino code.Was a nice project to do after a long working day.This was the first I did with my "new" Tek 475 (this was my early chistmas present to me this year, have it only some days now - I felt like my other scopes needed a new friend).Bought it from a collector and it was former used in the army, so it is in very good condition, has only a little geometry problem (last "calibrated" in 2005).The waveform is on the top smaller than on the bottom.I knew you are a Tektronix engineer. If you have a tip for me...it would be nice (the only pot in the service manual I found for geometry is R1390 if I remember, but I don't want to deadjust the scope if it is the wrong one).Love your nixie tube frequency counter and your 465, they look great and work nice.And.. yes I will build up the R2R digital to analog converter next yearand try it out - sounds good.Nice greetings, Tom

author: w2aew
author_rank: Super Contributor
timestamp: December 14, 2013, 03:33:16 am
content: Cool! I'm glad you like my videos. Someday I hope I'll make videos as good as Dave!I really appreciate your little app to create the XY coordinate list. Nice handy program!FYI, if you're going to make the R2R DAC, keep in mind that you can simply buy the R2R resistor networks in a single package (DIP, SIP, etc.), rather than making them out of a bunch of individual resistors.On the 475, I'd say it would be best to start looking at the vertical preamp and drivers. Check supply voltages first. Looks like you've got the advantage of having a 2nd scope to use to troubleshoot the 475, that's good! I've never worked on that scope so really can't give you any more proper advice on the vertical issue your having.(I'm actually a Field Apps Engineer for Tek, not involved in design or service).

author: Aldobrandi
author_rank: Regular Contributor
timestamp: December 14, 2013, 05:06:25 am
content: My Christmas obsessed wife absolutely loves this. I'm going to have to try this following w2aew's awesome tutorials.

author: Redcat
author_rank: Regular Contributor
timestamp: December 15, 2013, 07:14:36 pm
content: So it's doneI build the R2R network today.I took the black mesh filter off the screen for the photo, but now it's in again (feel safer from radiation).W2aew's video was absolutely great and well explained, but it took me the whole day because I messed the cables up in the wrong order.And I had to write a new Arduino sketch and modify the coordinates tool...And in between I thought, my second channel on the 475 was gone in AC mode, but after opening the thing and measuring I finally found the error - silly me- the hooktipcap of the cheap probe was not right on the probetip.If still someone is interested, I updated the tool for the XY coordinates, so that it can be used with my arduino sketch.And the sketch is here to find:http://www.redcatimaging.de/wp-content/uploads/2013/t1/XYscope.inoupdateHere is the new code with the map() function:http://www.redcatimaging.de/wp-content/uploads/2013/t1/XYscopeMap2.inoIt has to be used with the 8 bit point coordinates and is mapped to the 6 bit in the arduino code (old sketch above uses 6 bit point coordinates).I use 6 bits for X (Pins 2,3,4,5,6,7) and 6 bits for Y (8,9,10,11,12,13) with the R2R net and the arduino. Not as detailed images as the PWM version, but really much much faster.Remember, the lowest Pin number goes to the first resistor -> the most left on w2aew's image (I hooked it to the last and wasted ours).I have a big box with a lot of nice old resistors here and the values I used are 27K (R) and 56K (2R) (measured both a little lower), but I think other values will work the same. Have also an additional 2R at the output, but I don't know if it's really needed.Nice greetings, Tom

author: w2aew
author_rank: Super Contributor
timestamp: December 15, 2013, 10:56:01 pm
content: Nice Tom. You could use the map() function to re-scale the coordinates.Another fun trick is to use sinewave weighting function along with map() to re-scale the X or Y values (along with an appropriate sign change) to make the image appear to be rotating/spinning.

author: Redcat
author_rank: Regular Contributor
timestamp: December 16, 2013, 12:25:37 am
content: Thank you Alan.I'm happy that you still follow this post and I've allready learned a lot from you.I think I have understand (most of) your R2R video and liked how you explained it with folding the paper.When I was at university 12 years ago I wish there was a teacher like you.This could be so nice projects for ee students...I've done several smaller and bigger microcontroller projects in the last years, but with an ATMega8 and Bascom and Arduino is new to me. Have some laying around for some fun projects like this and one build into a project actually.I didn't know how to scale the values down in Arduino, so i did in the editor and shifted the bits left for PORTD (X).I will definitely take a look at the map function, thank you.And I have seen these rotating images before (I think it was a cube...hmmm) and remember as you said that they are done with a sinewave, but same problem as before I didn't know how to do in Arduino.But I will try this too when I have more time.If you have a little hint for me how to mix this sinewave function with the map function...This project gets bigger than I thought.... But at least the R2R net is something for me to remember.Nice greetings, Tom

author: w2aew
author_rank: Super Contributor
timestamp: December 16, 2013, 01:30:03 am
content: I am really an analog guy, and a novice with things like uControllers, and know just enough about them and programming to be dangerous. So, there are probably better ways of doing it than what did.What I did was subtract the mid scale value from every coordinate, so that the range of values goes from +max/2 to -max/2 (instead of +max to 0). The sin() function varies between +1 and -1. Simply multiply each coordinate by the result of the sin() function which in a loop where you run through the sine values. Then, add the mid scale value to each values. This will scale your selected values (X or Y) and make it appear it's rotating.Again, I am sure that there are much better algorithms out there from folks that are much better programmers than me.

author: Redcat
author_rank: Regular Contributor
timestamp: December 18, 2013, 10:51:31 pm
content: Hey there,used monday and tuesday evening to work a little an this project.The mapping function for the arduino as you suggested to me was easy to master, but it took me again hours to get the rotation "working" at least a little bit.I think the code is all right (?), but somehow the arduino is too slow - it does not move smooth (I even reduced the sin steps from 360 down to under 30 (in 15 deg steps) but does not change much).Again, if someone is interested, here is the updated arduino code:http://www.redcatimaging.de/wp-content/uploads/2013/t1/XYscopeMapR.inoI will update the code for the non rotating version (which now works perfect thanks to w2aew) in the previous post.And of course here is a little video :-).www.youtube.com/embed/M0KSyhJNmYANice greetings to all, Tom

author: w2aew
author_rank: Super Contributor
timestamp: December 19, 2013, 02:35:01 am
content: Quote from: Redcat on December 18, 2013, 10:51:31 pmRedcat - for what it's worth, here's the code I put together for the spinning XY graphic (which in this case happens to be a Tek logo from the 80s... This results in a nice, smooth horizontal spin. I used ports b and d, using the 6-bit port for the Y values. I used an R2R ladder on these ports to create the analog outputs. No video yet, but will make one if there's interest...(please, no flames on the code, I'm not a programmer...)Code:/** Tek Block letter XY display with spin effect* Created 31 Mar 2013 by Alan Wolke* uses PORTs and R-2R ladder - note Y limited to 0-63, 6-bit* R2R time constant 2.7k*10n* works well with scope set for 0.5V/div XY mode*/#define FIGURE_DELAY100 // trace delay in uS. Adjust as desired.#define NUM_POINTS38 // number of XY points in figure// x coords on port dbyte x_points = {10, 90, 90, 110, 130, 140, 140,90, 90, 97, 113, 120, 90, 90, 100,150, 150, 170, 170,195, 220, 190, 220, 195, 170,170, 100, 85, 77, 70, 72, 80, 90,60, 60, 40, 40, 10};// y coords on port b - limited to 0-63 with map function laterbyte y_points = {100, 100, 80, 82, 74, 60, 40, 40,50, 60, 60, 50, 50, 40, 30, 30, 100,100, 55, 80, 80, 45, 10, 10,35, 10, 10, 13, 23, 40, 60, 72, 80, 80,10, 10, 80, 80};// some initial starting values...byte x_min = 50;byte y_min = 50;byte x_max = 50;byte y_max = 50;byte x_mid = 50;byte y_mid = 50;byte x_half;byte y_half;void setup(){DDRD = B11111111; //initialize PORTs for writingDDRB = B00111111;byte t;for(t = 0; t < NUM_POINTS; t++){y_points = map(y_points,0,255,0,63); //re-map Y points to 6 bits}for(t=0; t < NUM_POINTS; t++) //get min, max and mid values of X and Y{x_min = min(x_min, x_points);y_min = min(y_min, y_points);x_max = max(x_max, x_points);y_max = max(y_max, y_points);}x_mid = (x_max + x_min)/2;x_half = (x_max - x_min)/2;y_mid = (y_max + y_min)/2;y_half = (y_max - y_min)/2;}void loop(){byte t;byte sx;float p;byte flip;for(p=0; p<314; p++){sx = ( sin(p/100) * x_half); // half-sine for X scaling to sim rotationfor(t = 0; t < NUM_POINTS; t++)// run through the points in x & y{PORTD = map(x_points, x_min, x_max, x_mid-sx, x_mid+sx); // scale X with half-sine about mid pointPORTB = y_points;delayMicroseconds(FIGURE_DELAY);// wait TRACE_DELAY microseconds}}flip = x_min; // flip X min and max values so next map is reversedx_min = x_max;x_max = flip;}

author: Redcat
author_rank: Regular Contributor
timestamp: December 20, 2013, 02:07:57 am
content: Holy cow, I totally messed up the sin() function (did think degrees not rad - wondered why your value was 314 and then it made) and additionally did not scale around the middle. Messed it totally. I'm wondering, why it almost seemed to work.(Nevertheless the non rotating code version is not perfect but should "work").So much debug time done (until the cows came home)...for nothingShould sleep and not think about the code at night.Thank you so much Alan for your work and for posting the right code. It works absolutely perfect.Don't know if this would be worth a video, maybe the concepts behind it.I like the R2R (Nr1) or like the one with tuning the filter with the sweep generator (this was my 2nd favorite).I look every day if there is a new one.Nice greetings, Tom