![]() |
![]() |
![]() |
|
|
|||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Hello,
I've been working from a couple of weeks on building a logic analyzer using an ATMEGA16 microcontroller. my fist goal is to make a 4 channel, 1MHz sampling rate analyzer. Future development are on the way. The connectivity to the PC would be via RS232 (or USB via a USB to RS232 cable) The PC will have a Visual basic program to receive all data an draw it. My goal is also to make the visual basic program capable of decoding UART, SPI, I2C, and CAN buses. I have already solved the PC to ATMEGA16 connectivity problem. I have also found a *new* idea to auto-correct the timebase of the ATM EGA based on the RS232 clock.. I have successfully coded the inline ASSEMBLY codes for 1MHz sampling. Sooner or later i should start on with the hardware implementation. My question: are people here interested in such a project? I am planing to take lot of pictures during the building of the project, and make the software available for download with documentation. That will be a lot of work, and i'll be happy to do it, if i feel that it of some interest to you. Is it? I also hope there will some active participation and suggestions from fellow members, which is logical considered such a project/software will be interesting for the electronics and robotics community. Waiting for your comments. Regards. |
|
|
|
|
|
|
(permalink) |
|
I am interested but would much rather see USB for PC connectivity.
__________________
search engine for electronic partsJunebug USB PIC programmer kit., USB Bit Wacker, Homepage The 15 Minute Printed Circuit Board! (+drill time) |
|
|
|
|
|
|
(permalink) |
|
Well, i am actualy gonna use the RS232 TO USB cable to use it on my laptop..
|
|
|
|
|
|
|
(permalink) |
|
anyway.. i feel like the community here - to my surprise - is not very motivated about such a project...
|
|
|
|
|
|
|
(permalink) |
|
The PICkit2 has a builtin 3 channel 1mhz logic analyzer built in to the software. USB too.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
lol, anyway, i wanted to ask, is 1MHz logic analyser means that it can sample clearly signals at 1Mhz, or that it takes 1 Million samples per second? |
||
|
|
|
|
|
(permalink) |
|
I think it sounds great Ika
I've played around with VB quite a bit with regards to UART, but not with USB unfortunately.. If you keep it simple, then the raw programming of the micro will be minimal, especially if you use UART The Logic Analyzer; Monitor the status of the Pin and when it changes send a byte through UART with the relevant information (high/low). The VB program will display a running image with the data with its refresh rate (time scale) being changeable by the user. The time it takes to send one byte via UART will be your smallest resolution. Its crude, but it will work for a simple logic analyzer, and will get decent speeds with a fast enough UART. The Oscilloscope; This will require bi directional UART, primarily for setting the time scale. Create a routine that waits for a positive zero crossover, and then grabs 256 samples and stores the data into an array. The time between samples could be extended with NOP's or by burning cycles (as required by the user on the VB side of things). Send the 256 bytes of data to the PC, for display on the VB program. It simply maps the 256 ADC values on a graph and waits for the next signal. Your thoughts? Sorry about your post on my site BTW, I used Web Expressions to update the site instead of a standard ftp program, problem is, it deleted all folders that were not found locally on the computer - the forum being one of them.
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
I'm not at my computer but I recall it alises @ 500kHz. Handy tool either way, plus a UART tool too. Not too shabby for an inexpensive programmer / debugger.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
You can go faster, but you will not be able to sample the complete sinusoidal signal, or decrease the resolution of the result Zero crossover detection is simple, Code:
While True
// ensure the signal is below zero crossover
Repeat
Until Adin(0) <= 511
// wait for the signal to go positive above zero crossover
Repeat
Until Adin(0) >= 511
// take samples
Sample = 0
For Sample = 0 to 64
ADCSample(Sample) = Adin(0)
DelayuS(TimeScaleFactor)
Next
// write data to UART
USART.Write("New Sample")
Sample = 0
For Sample = 0 to 64
USART.Write(Convert.DecToStr(ADCSample(Sample))
Next
Wend
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
||
|
|
|
|
|
(permalink) | |
|
Quote:
I however intend to give the user the possibility of "free running" analyzer, where the 4 channels will arrive at the same speed of the UART, this mode will allow the user to see the channels live, but won't be optimized for speed.. gramo, i have a question, with 1 MHz sampling rate, what is the maximum frequency of the signal that can be analyzed clearly.. if you see what i mean? In other words, how much higher the sampling frequency has to be than the measured signal frequency for acceptable results? and about the OSC, thanks but i really want to stick to the logic analyzer for now.. one thing at a time! but thanks anyway |
||
|
|
|
|
|
(permalink) | |||
|
Quote:
This will suite most applications given the target audience I'd imagine Quote:
Quote:
Nps, just putting it out there for you
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
||||
|
|
|
|
|
(permalink) | |
|
Quote:
Sorry, I didn't explain that bit, I came from the oscilloscope perspective working with the frequency of a sinusoidal wave. Your resolution will be limited by the code overhead of the samples for the logic analyzer, from there you can calculate the error/max frequencies attainable
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
||
|
|
|
|
|
(permalink) |
|
Let me put it this way:
i allready managed to write the code to achieve 1MS/s. What is the max frequency of the signal that can be sampled? 2.5 times less as some websites say, although i am skeptic..? or what? thanks for your enlightening! |
|
|
|
|
|
|
(permalink) |
|
Have you seen this? I am not suggesting anything by pointing it out other then it is an interesting open source LA effort.
FLASH - PLAICE: Programmer, Logic Analyzer and In-Circuit Emulator Project
__________________
search engine for electronic partsJunebug USB PIC programmer kit., USB Bit Wacker, Homepage The 15 Minute Printed Circuit Board! (+drill time) |
|
|
|
|
|
|
(permalink) | |
|
Quote:
Ask yourself this simple question: If there are two logic levels changing one after another, will my sampling frequency will be fast enough to catch and distinguish them? E.g. You have two 1KHz square signals. The rising edge of the second one lags the first one by 100ns. Will the sampling results tell them apart? What if they differs by 500ns or even 1us?
__________________
L.Chung |
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Homebrew Logic Analyzer | Marks256 | Electronic Projects Design/Ideas/Reviews | 4 | 1st August 2006 02:34 AM |
| USB logic analyzer | patroclus | General Electronics Chat | 3 | 21st October 2005 07:51 PM |
| Logic Analyzer | RonH | General Electronics Chat | 0 | 27th March 2005 04:59 PM |
| Logic analyzer | RonH | Electronic Projects Design/Ideas/Reviews | 1 | 8th April 2004 03:34 AM |
| Logic analyzer | Natasha125 | Electronic Projects Design/Ideas/Reviews | 1 | 2nd March 2004 03:14 PM |