EV3 Color Sensor protocol - uart

I am facing problem related protocol EV3 Color sensor. ( Background: I have implemented the embedded system with Uart on FPGA,receiving information from EV3 color Sensor and write the C program to operate Sensor Color mode. It sent all correct initial information but when I sent back acknowledge and changed baud to 57600, Sensor not sent correct data ( I am only getting zeros with some irrelevant HEX codes.) I want to ask that Should I sent the nack first then expected data. OR something you know about this step.
Initial information OF EV3 Color sensor:
00FF (401DA2490502B1 TYPE,ID,MODE) (5200E100004C SPEED 57600)
(MODES and its information:
9D00434F4C2D43414C00419D010000000000FF7F47A49D030000000000FF7F47A6958004010500EA9C005247422D524157005D9C0100000000000C7F44559C0300000000000C7F4457948003010400ED9B005245462D524157005C9B0100000000000C7F44529B0300000000000C7F4450938002010400EBA200434F4C2D434F4C4F52000000000000006D9A010000000000000041259A030000000000000041279A04636F6C000000000001928001000200EEA100434F4C2D414D4249454E5400000000006B9901000000000000C842ED9903000000000000C842EF9904706374000000000005918001000300ECA000434F4C2D5245464C45435400000000007D9801000000000000C842EC9803000000000000C842EE9804706374000000000004908001000300ED)
04 ACKNOWLEDEG
protocol that I following is from this website.https://sourceforge.net/p/lejos/wiki/UART%20Sensor%20Protocol/

Related

LTC6810 Battery Management system CRC error in SPI communication

I'm working on a BMS project for an electric car. I'm using LTC6804-2 for voltage and temperature measurement in each cells. As a first step of development, I would like to establish a successful communication with the monitoring IC (LTC6804-2). So, I'm sending set config register command and trying to read back the config register values that I have written. If I receive the configuration register values without a CRC error, I consider my communication as successful.
In my case, I do not receive expected register values with proper CRC when I read back. Let me break down my situation into small segments.
I'm working on a custom BMS board for this project(LTC6804-2 and STM32F072). I will attach the schematics below. To test my code, I tested my program with DC1942C demo board and arduino UNO. And it is working fine. I can read back the config register and I can calculate the cell voltage and Auxiliary values.
When I try to implement the same program in my custom BMS board, I'm not getting the correct values. I always get CRC error in the received data.
Following the guidelines from the Analog Devices forum, I tested the Vref2 value after sending the config register command, and the voltage goes up to ~3V as expected. So the IC is receiving the message properly. But Why it is not transmitting back?
Below are the captures from the demo board and BMS custom board.
Register read capture from Arduino Uno and demo board DC1942C
Register read capture from the custom board
In fact I tested the program with STM32 development board and DC1942 demo board, I get the correct values.
Thank you for your help. If you want any additional details, please let me know.
LTC6810-2 datasheet

demodulate GFSK with quadrature demod

Hi I am trying to demodulated a GFSK signal using gnu radio
I connected an osmocom source to FIR filter and the filter to Quadrature demod (which output the signal to a file)
as shown here:
my flow graph
the Quadrature demod gain is - samp_rate/(2*pi*deviation/8).
Using Audacity I opened the file containing the demodulated signal. however no matter what packet I send (even if I don't send anything) I don't see the peeks which suppose to stand for a packet.
demodulated signal shown in audacity
you can see hear an example ,it seems that my device is sending packets constantly.
what am i doing wrong?
I think you should change Sample Rate from 4M sps to a value greater than Ch0 Frequency (currently 868M Hz).

How should items that function at different baud rates work together?

I've got an Arduino Uno which I'd like to setup to with a TTL Serial JPEG Camera for image capture and send that data using a GPRS shield.
Currently I've got the two pieces of hardware working independently. The camera is taking and storing photos. The GPRS shield is sending SMS, and connecting to web urls.
Now that I've confirmed both work in isolation, how do I combine the code? The baud rate for the GPRS is set at 19200 and the camera at 9600. I've tried to set the baud of the GPRS shield down to 9600 and while it 'runs' I don't get any response from the text message I tried to send. Also the camera documentation says not to change the baud rate. Any guidance is appreciated
Connect these two devices to two separate serial lines. Since you're on an Uno, which has only one hardware Serial line (pins 0 and 1), you can use SoftwareSerial to use another pair of pins as a second serial line.
Then you can simply specify different baud rates when setting each serial line up.

Making I2C work on PIC18

I'm using PIC18F87J11 as the master and LiPower Shield as the slave, and all I want to do is to be able to read the battery voltage value from the LiPower Shield. I'm using MPLAB C18 libraries for the I2C communication. I'm not able to get correct readings as I think the communication between the two devices is not setup correctly.
I'm looking for interpretations of the waveform signals in order to detect the issue. Also I would like to know if I'm missing something in the code. Any recommendations to improve the code would be helpful.
The LiPower Shield came with a sample code for Arduino but I'm using PIC18 chip from Microchip. The sample code is found here.
Here is the signals I'm getting while trying to read the battery voltage.
Code:
SSP2ADD = 19;
OpenI2C2(MASTER,SLEW_OFF);
StartI2C2();
IdleI2C2();
WriteI2C2(0x36);
IdleI2C2();
data = ReadI2C2(); // Read byte of data
printf ("\r\nAddress 32");
printf (" Byte:");
PrintChar(data);
IdleI2C2();
AckI2C2();
IdleI2C2();
WriteI2C2(0x02);
IdleI2C2();
data = ReadI2C2(); // Read byte of data
printf ("\r\nAddress 02");
printf (" Byte:");
PrintChar(data);
IdleI2C2();
AckI2C2();
StopI2C2(); // Stop condition I2C on bus
Output: Which I think is wrong.
Address 32 Byte:FF
Address 02 Byte:FF
I'm not really sure if I'm writing/reading from the correct address, but that's the address they used in the their sample code. I hope I can get some interpretations on the signals and feedback on the code if possible.
I'm not familiar with the PIC but your code looks nowhere near right. Per the MAX17043DS datasheet, page 12, a memory read must consist of the following:
I2C start condition
Write device I2C write address (0x6C)
Check for ACK from slave
Write 8-bit memory address
Check for ACK from slave
I2C repeated start condition
Write device I2C read address (0x6D)
Read first byte of data
Send ACK
Read second byte of data
Send NACK
I2C Stop condition
What I see in your code is an I2C Start condition followed by a write 0f 0x36. Since this is not the device address the slave recognizes, it sends a NACK (as seen on your logic analyzer traces) and ignores everything else.
This question and answer has a lot of information on I2C on a PIC18. You also should probably find a read a basic I2C tutorial.

Serial device with no documentation, GPS board

I have a GPS circuit board from china. The only information I can find on this thing is :"amoj GPS 04C www.amoj.com"
It has a serial (DB9) connection and I would like to determine how to putty into it or something.
How can I determine what the port settings that are required to access this?
Pictures below:
Photos in Dropbox
The Jupiter TU60 serial interface is 9600 8N1 by default. The only sentence it will output automatically is the flash checksum message about a second after power up. Google the datasheet for the device and it will let you know about this.
To have it output the position and other information, you must command it to do so. There is a default set of commands that are active after power up. They begin with ## and are from the protocol used by Motorola. Refer to the M12+ Users Guide and Supplement (available online) for information on how to use these commands. I have been able to enter them from Realterm. The only tricky part is calculating the checksum. You can use most hex calculators to do that.
According to the datasheet, the unit goes into survey mode automatically and after about 24 hours goes into position hold. The 1PPS and 10KHz signals are valid to less than a microsecond after a few minutes after power up and to 50nS after a day. I have compared this to another standard I have to verify this. You can use the ##Ea command to get the status of the unit and the M12+ Manual will tell you how to decode it.
Look for $GP... messages at 4800 and 9600BPS as yegorich suggest. Common NMEA messages output by GPS devices are $GPGGA, $GPVTG, $GPRMC.. If you find that data coming out, use Google to look up NMEA 0183 sentence structure and you will have what you need...
I have the same board with the Navman jupiter T Tu60 GPS 1pps 10khz GPS Module on it. I just received my sma antenna and have hooked it up. I am using 12.6V power to the centre pin.
It outputs 1pps on the led with no signal, so that is not to be trusted. Mine is labeled 1pps and 10khz underneath the pcb but these are actually swapped! I put the 10KHz output on my dso and get a 10KHz square wave 50% duty cycle signal but there is ringing on the waveform rise so I have to set the trigger level to 0.8v to get the dso to register the 10KHz frequency. I suspect this may be because the output expects a load and is not seeing one. Now, was I using ac or dc coupling?
I too am getting nothing on the serial. I tried 9600, 4800 using putty on com1 (I have a nice old motherboard) and then tried reversing rx and tx but no luck. As of now I am checking out the serial signals with the dso to see if I can work out what is happenning. I suspect that these boards are rubbish, and useful as power supplies only.
It reads 10.0000 on my hp 5328a counter and sometimes reads 9.9999. It would be nice to be able to talk to the gps to see whether it has satellite lock.
Please let me know how you get on and if you find out any further info.
Brett VK6EZ.