- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now i get (console output) always the same value, nothing changes.. Also not if i try to get data from other geisters. So i believe i do something wrong, but i don`t know what.. or where to start searching. Can anyone support me on that?
My first step is just to get something, regardless of which data exactly, compensation parameter etc..
There is communication (oscilloscope), but nothing correct.
Find in the attachment screenshot of:
- QSYS
- NIOS c code
- NIOS c code
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Roman,
Can you share the design?
Your driver & Qsys system looks fine, Need to check the software side.
Regards
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Roman,
Okay,
For debugging can you try to read slave device address using alt_avalon_i2c_master_target_get.
Refer below link for API example.
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_embedded_ip.pdf
Regards
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anand
With the code in the attachment i get the following output:
Hello from Nios II!
targetadress 0x0
Error
Read chip ID: Read chip ID: Read chip ID: Read chip ID: Read chip ID: Data
Data
Data
Data
so it seems he even do not set the target address 0x76.
When i use the oscilloscope, there is no communication on the pins.
Thank you!
Regards
Roman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Roman,
Is your BME280 SDO pin connected to the ground? check hardware connectivity.
Try to read the slave address without writing it.
Regards
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anand
Oh i found the wiring issue... (unbelivable :( )
However, now i`m back at my initial problem, that the slave sends me some data that i am not expecting.
In the attachment is an oscilloscope picture, communication via NIOS2. The Slave sends me wrong data, but i a don`t know why and how i can control that from NIOS. (An osci picture from an working communication via arduino is in my first post)
I thought it is a missing initialization step but i can`t find any difference to the examples from Bosch.
alt_u32 txbuffer[0x200];
alt_u32 rxbuffer[0x200];
txbuffer[0] = 0xFA; //MSB
txbuffer[1] = 0xFB; //LSB
txbuffer[2] = 0xFC; //XLSB
while (1)
{
status = alt_avalon_i2c_master_tx_rx(i2c_dev, txbuffer, 1, rxbuffer, 3, ALT_AVALON_I2C_NO_INTERRUPTS);
usleep(1000000);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
- Temperature data may be randomly changing better read some other register.
- The tx buffer contains the 1-byte address, Is address (FA)correct ???
it should be 2 bytes FA & FB for temperature data.
Instead of reading temp data, read chip id and check if you are getting expected output for debugging.
Buffer[0]=D0;
alt_avalon_i2c_master_tx_rx(i2c_ptr,buffer,1,buffer,1,0);
Regards
Anand

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page