Search found 921 matches

by mnfisher
Sun Jun 02, 2024 9:08 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

LabNation_Screenshot28.png
LabNation_Screenshot28.png (259.42 KiB) Viewed 24 times
by mnfisher
Sun Jun 02, 2024 9:06 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

Did you try the interrupt version? - I've had it running all day (I was out) - and it has not missed a beat. Also - being interrupt driven means that the slave doesn't have to busy wait on the i2c status. The master controls the data transfer (send and receive!) - and inter-mcu communication is good!
by mnfisher
Sat Jun 01, 2024 11:28 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

A bit more playing and I almost got it to work by tweaking the CAL_I2C file - but it would work for one time and then stop. After a bit more fiddling - no joy. So - I rewrote the slave side using the TWI interrupt to handle receipt and sending of data. This worked remarkably easily - so here is a ve...
by mnfisher
Fri May 31, 2024 9:01 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

Another step forward :-)

The RTC is acting as a slave device. Could maybe look at the output for this and see what/how it varies?
by mnfisher
Fri May 31, 2024 8:46 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

Another 'oddity' - when writing m->s there is an ~18us delay between bytes. On receiving s->m there is a much shorter 'gap' (~8us) and adding a delay after each byte is transmitted doesn't affect this as expected - adding a 1ms delay gives 2 bytes with first value (and a 8us delay between them) then...
by mnfisher
Fri May 31, 2024 8:09 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

Looking at your screenshot - after the 'receive' SDA stays low which holds the i2c bus as 'busy' - and prevents further transmission. If you look at the trace I posted - you can see that SDA goes high again after the 'read' It might be a slightly different board - could you try a pull-up resistor on...
by mnfisher
Fri May 31, 2024 7:35 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

It is very odd = what hardware are you testing on? As you can see from my screenshot it had counted up quite a few iterations when I took it? Can you 'disable' the 'Read' in the sender (master - will perhaps have to think again about the naming!) Iain - can you remember what you got returned by the ...
by mnfisher
Thu May 30, 2024 9:26 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

I've had one step forwards and one 'to the side' So - having ascertained that transmit works AOK (for me :-) ) I rewrote the code to use the I2C CAL component and transactions )notice how this makes the code for the master much simpler) I also just use the scope here (and as smartscope has decided t...
by mnfisher
Wed May 29, 2024 2:11 pm
Forum: Bug Reports
Topic: ESP32 timer interrupt problem [SOLVED]
Replies: 7
Views: 208

Re: ESP32 timer interrupt problem [SOLVED]

Cool - glad it's working for you...
by mnfisher
Wed May 29, 2024 2:10 pm
Forum: User Components
Topic: 2 Arduino I2C communication
Replies: 23
Views: 378

Re: 2 Arduino I2C communication

It's odd that it just worked one time for you - repeated every second for me. Strange. Initialise is needed before using the i2c (once only), the transaction routines allow a simpler interface (it handles start and stop conditions. Transactions are also the only available interface on some MCUs but ...