Search found 428 matches

by fotios
Sun May 03, 2020 7:17 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Good spot. Do you believe that I was able to find the bug? :lol: I'm not so smart, and so I asked in Particle community forum :roll: and got the fix. Simply, the members of it, are not so polite like all of you here in Matrix forums. The reply I got nearly was : "Hey man, are you serious? You expec...
by fotios
Sun May 03, 2020 6:22 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

For anyone interested, here is the correct I2C Slave Wire (Arduino) code for UINT16 type (2 bytes) number reception: void receiveEvent(int howMany) { while(2 < Wire.available()) { // loop through all but the last char c = Wire.read(); // receive byte as a character Serial.print(c); // print the char...
by fotios
Sun May 03, 2020 10:21 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Hi Martin OK, solved. The error was in the expression while(1 < Wire.available()) { // loop through all but the last It might be while(2 < Wire.available()) { // loop through all but the last to receive two bytes :lol: :lol: So, I suppose for 3 bytes it should be 3 and so on. A big thank to you again
by fotios
Sun May 03, 2020 8:40 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Thanks a lot again I got a new screenshot of the scope. Everything looks OK. From the left, the first byte is the Slave ID = 0x38<<1 = 0x70, the second byte is the DataH=20d, and the third byte is the DataL=150d. The black triangles point the 9th bit=ACK. Additionally, I use 2 blue LEDs mounted on t...
by fotios
Sat May 02, 2020 8:00 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Just to let you know. I tried transmitting two single and constant bytes repeatedly, DataH=20 and DataL=150: STM32: Start-->Tx DataH(20)-->Tx DataL(150)-->Stop The Argon receives: STdataH=150 and STdataL=255 So the DataL(150) is transmitted by sure but is received as STdataH. I couldn't be sure if D...
by fotios
Sat May 02, 2020 7:24 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Hi Martin
Thanks for the replies.
The target of my FCF is STM32F303RE.

I tried your correction but still, STdataL is received as 0xFF (255d) by Argon.

Thanks again
by fotios
Sat May 02, 2020 5:29 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Hi everyone I have a new issue. The master STM32 should transmit 2 bytes of data to the slave Argon each time. From the side of the master (supposing that the right way of transmitting multiple bytes is: START-->TX slave ID-->TX HI Byte-->TX LO Byte-->STOP) I have obtained the related FC code which ...
by fotios
Wed Apr 29, 2020 9:51 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Hi Martin At last, I got it working. I used the address 0x38 in the slave Argon, and in master STM32 I used "transmit address 0x70". I had tried it 2 days ago (following your suggestion) but failed. I think had flashed the Argon with different firmware. Now is flashed with the suggested master/slave...
by fotios
Tue Apr 28, 2020 10:41 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

6-7 years ago, using the FC5 I had obtained a successful I2C master code for a P16F1939 managing an S/PDIF transceiver and a DAC of Wolfson. I looked again at this code and the datasheets of WM8805 and WM8741. For example, the WM8805 has two possible I2C device addresses: 0111 010x or 0111 011x Acco...
by fotios
Tue Apr 28, 2020 9:56 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Yes, when a slave device is connected to the I2C bus and receive its address (or Device ID to not be confused with the Device Register Address), then the master after the transmission of the 7 bits of ID and 1 for R/W it releases (i.e. HI) during the 9th clock pulse the SDA line so that the slave co...
by fotios
Tue Apr 28, 2020 7:36 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

LabNation_Screenshot4.png Hi Martin and thank you for the picture. Looking carefully the Arduino i2c_scanner plot, and if I'm not missing something, I think in each 9th clock transition the SDA is in HI state. That means NACK and not ACK, i.e. the slave does not acknowledge the address transmitted ...
by fotios
Mon Apr 27, 2020 7:51 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Hi Martin Hmmm, I don't know what happened in your case. I still use the FC7 and it compiles successfully either the i2c master or the i2c slave functionality. Simply the i2c slave functions are still not implemented for the STARM family, you could see it if you open the STARM CAL folder. However, B...
by fotios
Mon Apr 27, 2020 8:19 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Here is a screenshot showing the I2C activity of my actual board with the STM32 configured as master and the Particle Argon as slave. The FC code of master is almost the same as in the previous example with the P16F1937. Both signals are much more clear. Simply the Argon doesn't respond. Could you s...
by fotios
Mon Apr 27, 2020 7:37 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Yeah, I know.
In the beginning, I used 10KOhms, now 4.7KOhms.
The result is the same.
Interconnections among the two micros are very short, solid wires for both SCL and SDA.
Here is a better screenshot showing all ten SCL transitions.
Capture-1.jpg
Capture-1.jpg (82.12 KiB) Viewed 2186 times
by fotios
Sun Apr 26, 2020 7:55 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Here is a screenshot of SCL and SDA
Capture-1.jpg
Capture-1.jpg (51.32 KiB) Viewed 2219 times
by fotios
Sat Apr 25, 2020 12:33 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

I did a simple example using Arduinos at https://www.matrixtsl.com/mmforums/viewtopic.php?f=71&t=20043&hilit=i2c+slave&p=87984#p87984 - I'll have a play see if I can get things working again - it was a long time ago when I'd just go FC.... Martin Actually, my main problem is the communication betwe...
by fotios
Sat Apr 25, 2020 12:10 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

I also realized a very strange thing!
The debounce was simply a very small transition at +5V!
The rest of the pulses are simply... 0-2V transitions!
The micros are working with 5V VDD on both boards.
Thank you again.
by fotios
Sat Apr 25, 2020 10:56 am
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

Re: I2C master/slave help

Thanks a lot, Martin Though I've read (I don't remember where exactly) within "about" menus, that the address is left-shifted automatically, I was thinking the same and tried instead 0x54 to transmit 0xA8. The same result. I checked again the SCL and SDA with the scope, more carefully this time, and...
by fotios
Fri Apr 24, 2020 8:46 pm
Forum: Flowcode V7
Topic: I2C master/slave help
Replies: 31
Views: 3474

I2C master/slave help

Hi there I have two separate boards, both equipped with P16F1937, and I try to establish I2C communication between them. One is configured as I2C master and the second as I2C slave. The two boards are connected with a third board, and as pull-up resistors, on SCL and SDA, I have selected 10KOhms. Th...
by fotios
Thu Apr 16, 2020 8:45 am
Forum: 32-Bit ARM
Topic: STM32 as I2C slave is supported?
Replies: 3
Views: 1311

Re: STM32 as I2C slave is supported?

Hi Ben Thanks a lot I know the case. There are so many peripherals with a lot of potential configurations included in these micros. From a point of view, it is chaos and I understand very well your efforts in helping us. In any case and having in mind that the master functionality is implemented, I ...
by fotios
Sun Apr 12, 2020 9:42 am
Forum: 32-Bit ARM
Topic: STM32 as I2C slave is supported?
Replies: 3
Views: 1311

Re: STM32 as I2C slave is supported?

Hi there Waste of time Only master is workable. I looked into the CAL_STARM_I2C folder. Here the result: //Slave functions currently not implemented CALFUNCTION(void, FC_CAL_I2C_Slave_Init_, (MX_UINT8 Address, MX_UINT8 Mask)) { } CALFUNCTION(void, FC_CAL_I2C_Slave_Uninit_, (void)) { } CALFUNCTION(MX...
by fotios
Thu Apr 09, 2020 9:33 pm
Forum: 32-Bit ARM
Topic: STM32 as I2C slave is supported?
Replies: 3
Views: 1311

STM32 as I2C slave is supported?

Hi I have a Particle Argon connected to an STM32F303 via I2C bus. The Argon is configured for the instance as the master, with Baud = 100KHz. The STM32F303 is configured as the slave as follows: Channel = Software Baud Select = 100KHz Slew Rate Control = Disabled SMBUS Inputs = Disabled SDA = Port F...
by fotios
Tue Feb 18, 2020 12:18 pm
Forum: 32-Bit ARM
Topic: STM32F3 SPI bus
Replies: 2
Views: 1319

Re: STM32F3 SPI bus

Hi Ben
Oops! :oops: You are right, I forgot it.
It compiles successfully now.
And the best is that it works flawlessly on my actual hardware as I can read back the last data that I've sent to the peripheral. :D
Thanks a lot
by fotios
Tue Feb 18, 2020 10:05 am
Forum: 32-Bit ARM
Topic: STM32F3 SPI bus
Replies: 2
Views: 1319

STM32F3 SPI bus

Hi I try to compile an FC in which I also have included the SPI function. The SPI ports are undeclared? My target is STM32F303RE . In my hardware, I have two peripherals connected at SPI1 and SPI3 . Here the error message C:\Program Files (x86)\Flowcode 7\CAL\STARM\STARM_CAL_SPI.c: In function 'FC_C...
by fotios
Wed Feb 12, 2020 9:50 am
Forum: Electronics products
Topic: Bantham, wireless energy meter
Replies: 4
Views: 2179

Re: Bantham, wireless energy meter

Hi
Just now I found in my HD two debugged FCFs exclusively for LoRa SX1262 TX and RX. The macros for ATM90E32AS are not included. The pairing process is also not included.
LoRa_1262_TX v1.0.fcfx
(66.68 KiB) Downloaded 78 times
LoRa_1262_RX v1.0.fcfx
(89.15 KiB) Downloaded 76 times
Thanks