Comments (56)
Found the pin mapping I guess
https://robotdyn.com/pub/media/0G-00005642==MEGA-PROMINI-ATmega2560/DOCS/PINOUT==0G-00005642==MEGA-PROMINI-ATmega2560.pdf
from msrc.
I've improved the pin table with usual pin numbers
Which rx protocol are you using? smartport, xbus, srxl?
Are you attaching a esc serial or castle?
from msrc.
I am using a Radiomaster R161. Smart port wire and VCC and GND go to the Mega2560 pin VCC/GND and D4/D12 with pullup). S.Bus + VCC and GND go to FBL
msrc.lua does not detect the board and no sensors are detected. Was working with 328P pro micro before. Are ports D4 and D12 (4 and 12) the correct ones for smartport?
from msrc.
There was an error on the readme. Fixed. Correct pins for ATmega2560 are 10 and 15
from msrc.
Thanks, will try it out
from msrc.
Indeed, much better now :-)
from msrc.
Is it correct that BN-220 GPS TX goes to pin D17 on Mega2560? I do get a GPS signal (VCC is connected to 5V and GND to GND) but the coordinates are garbage as are the other GPS values. Same applies for BMP280 ALT value
from msrc.
Yes, D17 is the correct pin for GPS. Be sure you have set the default baud rate 9600
I'll check GPS and BMP280 for ATmega2560 in the following days
from msrc.
Yes, D17 is the correct pin for GPS. Be sure you have set the default baud rate 9600
I'll check GPS and BMP280 for ATmega2560 in the following days
Do I have to set baudrate in your code somewhere?
from msrc.
If you are using other baud rate than the default 9600 in BN220 you can change its baud rate (with ucenter app from ublox) or you can change line 450 in smartport.cpp
GPS_SERIAL.begin(9600);
with the desired baud rate
Edit: added GPS_BAUD_RATE to config.h, line 23. You can adjust the GPS baud rate in config.h
from msrc.
To debug the gps, download latest code as debug for gps was broken
Enable gps debug in config.h, line 119:
#define DEBUG_GPS
and post the output (with serial monitor at 115200)
from msrc.
Please download latest code: now all gps values are initialized to 0 so you won't get garbage values if there is no data input from the gps
from msrc.
Same applies for BMP280. You were getting garbage values because BMP280 is not communicating with Arduino
Now I've updated the code so altitude will be 0 even if there is no data input from BMP280. Note that the default I2C address for BMP280 is 0x77, but also can be 0x76
Download latest code and review connections and config
from msrc.
For BMP280 there was an issue with the altitude calculation. Fixed
from msrc.
Date/time and lat/log values were twisted. Fixed
Also altitude is now limited to values bigger than 0
from msrc.
GPS looks OK now, still 0m with BMP280 (address 76 since pin determining address is not connected to anything)
I'll continue investigating
from msrc.
Do you get a valid value for bmp280 temperature at sensor Tmp1 (0x401)?
Altitude is 0m at ground
from msrc.
temp is 0 deg
alt = 0m
from msrc.
Seems BMP is not working. Connection is straaight forward if SCL and SDA pins are corresponding in schema vs code
from msrc.
If you are using lua for config, i2c address is in decimal, 0x76 is 118 and 0x77 is 119
And connect BMP_Vcc to 3.3v and BMP_GND to GND
from msrc.
Hmm, address might be wrong indeed
from msrc.
Since the last commit I do notice when clicking update in LUA, UPDATING takes forever. Wi have to stop it with ret key on TX. When restarting msrc.lua, values are retained.
from msrc.
There was a bug in the lua script that was causing wrong I2C config. Please upload the latest lua script to the radio, update config and check if BMP is working
from msrc.
Since the last commit I do notice when clicking update in LUA, UPDATING takes forever. Wi have to stop it with ret key on TX. When restarting msrc.lua, values are retained.
Fixed. Please flash latest code
from msrc.
Updating still keeps flashing. I have to quit it with return.
Alt and Tmp1 remains 0.
Awaiting new sensor module which should arrive any day now. Will swap module to try this option.
from msrc.
- Could you flash the latest code and enable in config.h:
#define DEBUG_EEPROM_WRITE
#define DEBUG_EEPROM_READ
And post the result when booting and also when updating from lua
- Disable the previous and enable
#define DEBUG
and post the output when updating from lua
from msrc.
Sorry, now is updated for debug
from msrc.
Can I connect both the S.Port connector and the usb connector to the Mega2560 board at the same time to output the debug? Won't overload board nor PC USB Port? Just to be sure
from msrc.
Disconnect Vcc from smartport, keep only GND and data lines
from msrc.
1. Could you flash the latest code and enable in _config.h_:
#define DEBUG_EEPROM_WRITE #define DEBUG_EEPROM_READ
Gives
V0.8.0 RC Pr:4 As:0 Gp:1 V1:1 V2:0 Cu:1 T1:0 T2:0 Po:1 rR:10 rV:10 rC:10 rT:10 aR:3 aV:3 aC:3 aT:3 I1:1 A1:118 I2:2 A2:0 RC Pr:4 As:0 Gp:1 V1:1 V2:0 Cu:1 T1:0 T2:0 Po:1 rR:10 rV:10 rC:10 rT:10 aR:3 aV:3 aC:3 aT:3 I1:1 A1:118 I2:2 A2:0 9⸮&⸮$⸮⸮⸮�ą⸮⸮R⸮⸮⸮vq⸮⸮�M'⸮)t6�⸮H⸮ɉ�⸮⸮⸮⸮⸮⸮ V0.8.0 RC Pr:4 As:0 Gp:1 V1:1 V2:0 Cu:1 T1:0 T2:0 Po:1 rR:10 rV:10 rC:10 rT:10 aR:3 aV:3 aC:3 aT:3 I1:1 A1:118 I2:2 A2:0 RC Pr:4 As:0 Gp:1 V1:1 V2:0 Cu:1 T1:0 T2:0 Po:1 rR:10 rV:10 rC:10 rT:10 aR:3 aV:3 aC:3 aT:3 I1:1 A1:118 I2:2 A2:0
And post the result when booting and also when updating from lua
1. Disable the previous and enable `#define DEBUG` and post the output when updating from lua
gives a lot, but when clicking update I get
M+ <F:31 D:5000 V:AAAA96F1 <F:31 D:5000 V:43333F2 <F:31 D:5000 V0.8.0
after that it remains UPDATING and no further debug output
from msrc.
I2C config seems good (I1:1 A1:118). You could try with address 119 (0x77), just in case
The arduino is rebooting when updating from lua. That's why lua keeps trying to update
from msrc.
Fixed the updating forever issue with lua. There was an issue deleting objects
Please try latest code
from msrc.
I've got BMP280 working at 0x76. I recommend to test BMP280 with a specific sketch (that you can find in some arduino libraries). You may need to replace the sensor. Remember to connect BMP Vcc to 3.3v, not 5v
from msrc.
Thanks, will try with a new sensor. Should arrive in the mailbox any moment now
from msrc.
The LUA on the Transmitter works well again.
The BMP280 (a brandnew one) does not give any telemetry data via I2C.
It is connected to
GND - GND
SDA - D20
SCL - D21
3V3 - 3V3
In LUA on TX I sellect I2C1 as BMP280 and address 118/119 (tried both)
TMP1 and ALT remain both 0
from msrc.
Please flash i2c_scan.ino (in tools folder) to check circuit and BMP module. No need to power the receiver or anything else
In serial monitor at 115200, you should see:
I2C scanner
76
Done
Where 76 is the address in hex. If no number, there is an issue with the circuit or the module
If you see the address, disconnect smartpoft Vcc, flash msrc.ino again enabling debug #define DEBUG
and post the output
from msrc.
Will have to search, BMP is brand new
I2C scanner
Done
D20 - SDA and D21 - SCL are correct right?
from msrc.
Yes, correct. Be sure they are not interchanged (try interchanging them just un case). Dont use long wires. It looks like a circuit issue
from msrc.
I see you are using a HW v5 LH ESC. Could you post the ESC signature by enabling #debug DEBUG_ESC_HW_V4
It will appear before raising throttle and the output is S: and some hex values. I'm trying to autodetect the ESC model to adjust sensor transformations
Are you getting correct values for the current?
Thanks
from msrc.
Actually I use a HW V4 => my config was wrong
from msrc.
Running out of ideas. Swapped SDA and SCL, same result.
The BMP gets 3,3V
Wires are 7cm
from msrc.
Do you have another Arduino to test with?
from msrc.
Could you post a picture or a link to your bmp280 module?
from msrc.
Your module may be stuck in SPI mode
I've modified the I2C scanner to loop every 3sec
Flash the updated i2c_scan.ino. To select I2C mode, CS pin must be high (3.3v) at startup (connect the pin before power up). I believe you can disconnect the pin after bootup and needs to be done only once
from msrc.
There is no CS pin on the module
VCC - GND - SCL - SDA - CS0 and SD0
from msrc.
CS=CS0
from msrc.
CS=CS0
CSB I meant. Tried that one, same result
from msrc.
Maybe a picture of the circuit you made will help
from msrc.
See attached. The yellow wire is going to D20 - SDA and the blue to D21 - SCL
VCC to 3.3V and GND to GND on the Mega2560 board.
from msrc.
Looks ok... don't know what else...
You can try connecting SD0 to GND or 3.3V. This defines the address (0x76, 0x77). With CSB disconnected or to 3.3v
You can try 5V version of BMP280, which is 4 pins and only I2C. Though I'm using the same board as you, 3.3v 6 pins, without any issue
Try with another Arduino
from msrc.
Can this come into play http://www.varesano.net/blog/fabio/how-disable-internal-arduino-atmega-pullups-sda-and-scl-i2c-bus?
The Mega2560 apparently outputs 5V on its I2C interface while the BMP280 is 3V3 only
from msrc.
If the case I probably blew up 2 BMP280-3V3 already :-)
Have 2 BMP280-5V ordered now to test. Will arrive in 6 weeks or so :-p
from msrc.
It might be. I always used a 3.3v BMP module without issues, but that does not guarantee other modules wont get burnt. Let me know
from msrc.
As a last resort you can try with external pull up resistors (4~5k) on SDA and SCL lines. See circuit (Keep D20/D21 for I2C on your ATmega2560)
from msrc.
In the meantime tested the BMP280-3V3 with an Arduino Pro Mini 3V3 (SDA -> A4 and SCL -> A5). I2CScan gives no address. Probably both modules are dead. Will try with the 5V version as soon it arrives
from msrc.
Even with a new BMP280-5V I get no output on Tmp and Alt
from msrc.
Related Issues (20)
- Jeti EX Bus GPS not working HOT 8
- Jeti - How to give the sensor a name
- Futaba SBUS - BMP280 variometer bug HOT 5
- About RP2040 Indicators are not blinking HOT 1
- Hall effect RPM sensor HOT 2
- FS Ibus problem
- Some detailed info for readme... HOT 2
- debugging HOT 5
- FrySky R9MM Support? HOT 2
- XBUS Transistor HOT 2
- RP whit BMP problem HOT 1
- Improper Pathing in .vscode HOT 1
- Jeti issues HOT 4
- blheli_32 telemetry support?
- HobbyWing Platinum V5 telemetry support? HOT 1
- Hobbywing with Ethos Voltage Sensor > 50 Volt HOT 1
- No GPS on iBUS HOT 2
- having a similar problem to closed issue XBUS-Connection to AR8020T-Receiver #95 HOT 2
- possible support for Flysky SBUS HOT 1
- pinout image has error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msrc.