ordered files, added esp8266

This commit is contained in:
aster94
2019-01-06 18:41:58 +01:00
parent 6c6402743a
commit 9d714f940d
7 changed files with 647 additions and 614 deletions

View File

@@ -1,8 +1,17 @@
/*
* ESP8266.ino
*
* Author : yoursunny
* Led: LED_BUILTIN
*/
#include <c_types.h>
#define baudrate 115200 // check if it is the same in processing
// number of samples to collect
static const int N_SAMPLES = 300;
// what pins to use, between 0 and 15
static const int PIN0 = 4;
static const int PIN1 = 5;
@@ -18,7 +27,7 @@ static_assert(PIN3 >= 0 && PIN3 < 16, "");
static constexpr uint32_t MASK = (1 << PIN0) | (1 << PIN1) | (1 << PIN2) | (1 << PIN3);
void setup() {
Serial.begin(115200);
Serial.begin(baudrate);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);

View File

@@ -1,8 +1,8 @@
/*
* LA.cpp
* MEGA.ino
*
* Created: 11/12/2016 19.35.51
* Author : Vincenzo
* Author : Vincenzo / sancho
* Modificaciones agregadas para funcionar con ArduinoMega2560 por Enmanuel Sancho Quintanilla
* La unidad minima en tiempo para este sistema es de 8 micro segundos lo que idealmente permitiria
* observar clocks con periodos de 62 kHz sin embargo para poder apreciar las señales logicas con suficiente
@@ -10,7 +10,9 @@
*/
#define baudrate 115200 // check if it is the same in processing
#define samples 10
#define samples 200 // the number of samples you want to take
#define pin_used
#define timezerooffset 125 //microsegundos
#define PULLUP true //Si queremos entradas con PULLUP lo dejamos activado(true), si queremos dejarlas al "aire" (false), en caso de desactivarlo deberemos aterrizar todos los pines que no utilizemos.

View File

@@ -1,11 +1,18 @@
/*
Author : Vincenzo G
https://www.hackster.io/vincenzo-g/diy-logic-analyzer-f61ee5
* STM32F1.ino
*
* Author : Vincenzo
* this works using the unofficial STM32 core, more info: https://github.com/rogerclarkmelbourne/Arduino_STM32
* Led: PB1
*/
#define samples 300
#define baudrate 115200 // check if it is the same in processing
#define samples 200 // the number of samples you want to take
#define boardLed PB1
uint8_t initial, state, old_state;
uint8_t pinChanged[samples];
uint32_t timer[samples];
@@ -16,7 +23,7 @@ uint16_t event = 0;
void setup() {
Serial.begin(115200);
Serial.begin(baudrate);
pinMode (boardLed, OUTPUT);
digitalWrite(boardLed, LOW);

View File

@@ -1,12 +1,13 @@
/*
* LA.cpp
* UNO.ino
*
* Created: 11/12/2016 19.35.51
* Author : Vincenzo
* Led on A0
*/
#define baudrate 115200 // check if it is the same in processing
#define samples 200
#define samples 200 // the number of samples you want to take
#define F_CPU 16000000UL
#include <avr/io.h>

View File

@@ -1,32 +1,39 @@
# Logic Analyzer
A few days ago I needed a logic sniffer since I don't have any I thought to write my own code. It will work on every Arduino board or AVR and STM32. It could be very helpful to debug ISP, I2C and other serial communication where you think that could be an error.
A few days ago I needed a logic analyzer since I don't have any (and them are quite expensive) I thought to write my own code. It will work on every Arduino board, AVR, STM32 and ESP8266. It could be very helpful to debug ISP, I2C and other serial communication where you think that could be an error.
![la](https://image.ibb.co/mEAvfU/3.jpg)
## Usage
- upload to your board "UNO.ino" or "MEGA.ino" or "STM32.ino"
- choose your board and serial port on "processing.pde"
- Upload `UNO.ino`, `MEGA.ino`, `STM32F1.ino` or `ESP8266.ino` to your board
- choose your board and serial port on `processing.pde`
- run it and have a good debug :D
If you wish you could put a led on the arduino pin A0 to see when the MCU is recording, the number of samples is set to 200 but you could increment it until the memory is full.
If you wish you could put a LED to see when the MCU is recording, see the code of your board to know where to wire it. The number of samples is set to 200 but you could increment it until the memory is full.
To have it faster than possible the loop was reduced to the minimum number of statement and I am doing a lot of optimization! All the calculation are made after saving the data, and during the recording there are stored only the values of the pin that changed and when it happened.
I made a processing sketch to visualize it. Using the bar scroll at the bottom of the graph you could move along the captures or alternatively you could use the wheel of the mouse. With the "Start" button you can begin a new recording. Two divider have been added: one to use millisecond instead of microsecond and the other that work like a kind of "zoom" (to change it move the mouse over this button than use the mouse wheel; decreasing it you will zoom in, increasing zoom out). You are also able to save the current window in a .jpg or .tif file with the "Save" button.
It works on windows and Linux both 32 64 bit and android devices. I added also an Arduino test sketch if you would like to test this logic analyzer.
It works on Windows and Linux both 32 64 bit and android devices. I added also an Arduino test sketch if you would like to test the logic analyzer.
Enjoy!
## Requisites
- [Arduino IDE](https://www.arduino.cc/en/main/software)
- [Processing](https://processing.org/download/)
# Change Log
##### 06/01/19
- ESP8266 version by @yoursunny, who also made a few improvements to processing, thanks!
##### 30/08/18
- MEGA version added by @sancho11, which now is a collaborator
- MEGA version added by @sancho11 but the processing interface is not compatible for all the pins
##### 29/04/17
- added support for STM32
- added support for STM32F1 using the [Arduino_STM32 core](https://github.com/rogerclarkmelbourne/Arduino_STM32)
##### 15/12/16
- improved acquisition code

View File

@@ -1,3 +1,10 @@
/*
* tester.ino
*
* Author : Vincenzo
* Test your logic analyzer with another arduino
*/
#define led A5
#define led2 13