Pages: 1 2 [3]   Go Down
Author Topic: arduino oscilloscope, a nice one :-)  (Read 17290 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I got the arduino to send data at 10,000,000 bauds/sec that means it will be able to sample higher frequencies.. So far the theoretical maximum is 28Khz, although in the practice we could say it's 10Khz since you need a few samples per wavelength.

Credits! I am getting such a speed up thanks to Kiril's post
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1242466935/0

It requires replacing the slowly arduino serial files by his, which are way better!

I still need to check if I can get the ADC to work faster since I think this is what limiting the throughput...


Ok, it's sat night, and its party time! Stay tuned for the release! ;-)
« Last Edit: October 02, 2010, 02:08:40 pm by xchip » Logged

0
Offline Offline
Jr. Member
**
Karma: 4
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi xchip, how's the coding going?

have you considered using a hardware interrupt as a way of the user communicating that the settings have changed on the interface?

If I understand your code correctly, the Arduino questions the serial port to see if there is incoming data from the PC to arduino.  If you changed this to a hardware interrupt the rest of the code might run faster.

For example, you would change the desired settings on the C# app such as no. of channels and time.  Then you would press a button on Arduino 'telling' it to communicate 2 ways with the application to get the new settings.

just a thought... I have not done any code like this myself but I think the theory is correct.  a little bit of incoming serial data *might* be lost during the ISR but I don't think that matters if you are in the middle of changing the settings anyway.

Also, you could get faster speeds by using an external ADC but I think that would make the project quickly become a lot more complicated and it would put it out of reach for many beginners..  I really like your approach so far and the bandwidth is plenty for my purposes.
 smiley
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey I am a bit busy right now with real life but I'll be back soon :-)

Feel free to change the arduino code in the way you think it will work best and if so well add your changes to the xoscillo codebase.

Sending data only when it changes is a good idea, the problem is that data is changing all the time, the interrupt would be triggered continuously and this would be a big slowdown... what you mention would be good if the signal was to change slowly or remain constant for long periods of time, which is not the typical case.

Logged

0
Offline Offline
Jr. Member
**
Karma: 4
Posts: 65
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, I understand about real life duties for sure : )

I think I did not explain myself well... or maybe I am way off about how the code works  - that is possible.

What I see is that the serial port has to be checked in the loop to see if the number of channels has been changed or if the trigger voltage has been changed.  My idea was to totally delete the command for reading incoming serial and have the person press a button on Arduino when they want it to get some new settings.  I am referring to this part of the code:

Code:

if (Serial.available() > 0)
  {
    // read the incoming byte:
    unsigned char in = Serial.read();
    
   //.....
    }
else
 {
   //read the analog input and send serial data.
 }

so... maybe that would speed up the loop if you need it.  What you would do instead is have a hardware interrupt (button) that the user would press and it would initiate the exchange of setup data after which normal/fast reading would commence.

it's just a thought.   smiley

Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey the command for reading teh serial is very fast and it doesn't cause a big delay, but anyway please feel free to try your approach and see what happens though! :-)

Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

BTW I updated the source code with the latest improvements to get higher sample rates.

I'd be nice if someone could test them to double check. If all goes well I'll update the release.

Thanks!
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

new and pretty version available!

Just in case you missed it smiley

link https://code.google.com/p/xoscillo/
« Last Edit: June 29, 2013, 01:58:22 pm by xchip » Logged

Pages: 1 2 [3]   Go Up
Jump to: