Download the program for the device via the Internet.

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! Now you can try the example from the "help" menu of the FC program. There was the first program to get data about the firmware version. So I need to connect the esp-01 module to my board, restore all connections with wires and send a command to get the firmware version and display it on the lcd1602 screen.

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! Again, nothing worked out, the message with the firmware version does not arrive. After this command, the program seems to hang. I decided to check if this is the case. I put the LED in the program in the old place where everything worked out. From the beginning, I set a flash test after receiving the firmware version-it did not blink in the program! then I put a flash test after showing the message "firmware test" on the lcd screen, where the LED was flashing in the program and in reality. The ESP-01 module was connected at that time.
Attachments
Atmega8_ESP-01_uart_FirmwareTest_flash_test.fcfx
(15.79 KiB) Downloaded 65 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Go back to the program that sent the "U" OK and confirm it still works.

Change everything in that program to run at 115200 baud.

Add in your LCD component and initialise

In your Loop, delete the SendString component and replace with GetFirmware

Add in the required component macros to display the result.

Hopefully it will loop displaying the result every second.

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! 1) When I loaded the program for sending the letter "U" with the LED flashing, the graph turned out to be normal, unchanged (this is if the esp-01 module is physically disabled), if the esp-01 module is physically enabled, then there is also a signal in the form of a meander.
2) I have an initialization of the lcd 1602 display in my program, only it is called "start".ъ
3)I do not have the "send string" module in my program, there is only "CetFirmeWareVersion".
4) the program has the necessary components to display the received data.
5)the transfer rate is 115200 for the ESP-01 module, on the uart module, which is not used in any way, the speed is 9600.
Attachments
Atmega8_ESP-01_uart_FirmwareTest_flash_test.JPG
Atmega8_ESP-01_uart_FirmwareTest_flash_test.JPG (39.28 KiB) Viewed 3478 times
yellow is the LED, green is sending the letter U when the ESP-01 module is turned on.jpg
yellow is the LED, green is sending the letter U when the ESP-01 module is turned on.jpg (66.05 KiB) Viewed 3478 times
yellow is the LED, green is sending the letter U when the ESP-01 module is disabled.jpg
yellow is the LED, green is sending the letter U when the ESP-01 module is disabled.jpg (58.39 KiB) Viewed 3478 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Clearly the UART is doing something as without it you can't get the ESP component to work. I can't explain that.

You scope traces are a bit confusing. In the chart you show that the LED flash is 300mS but the trace shows 1S with the Tx showing a whopping 8S high / 4S low.

Can you send me a rough schematic showing what is connected to where? Perhaps a picture too?

Going back to your chart that works when sending the "U", change baud to 115200 and see what happens. You should still get a "U".

Regards

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Using an UNO R3 (uses a 328P chip) I connected up at 115200 baud. No issue.

115200.jpg
115200.jpg (48.94 KiB) Viewed 3448 times

Zoom in

115200 zoom.jpg
115200 zoom.jpg (46.21 KiB) Viewed 3448 times

I then changed the flowchart to instead of sending a "U" it issued the GetFirmware command (AT+GMR CR LF). No issue there. However do note that as I did not have an esp8266 module connected, the flowchart "hangs" awaiting a response from it.

Issuing-Get.jpg
Issuing-Get.jpg (49.46 KiB) Viewed 3448 times
Zoom
Get Zoom.jpg
Get Zoom.jpg (53.49 KiB) Viewed 3448 times


R3-ESP_115200_Get.fcfx
(10.5 KiB) Downloaded 68 times

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! This letter was written before receiving your new schedules and letters, which I will now try to work out. There is no positive news today. In the program, I tried to initialize the uart module, then set the speed on it as on the esp-01 module, it was 115200. Then I looked at the oscilloscope: the LED was not flashing and there were no signals, but there was a meander signal on the output of the Tx controller, if there had been some kind of complex pulse signal, I would have thought that it looked like sending a signal to the firmware version, and since it looks like it, it is not clear what it means.
Attachments
Atmega8_ESP-01_uart_FirmwareTest_flash_test.fcfx
(15.93 KiB) Downloaded 69 times
dso_01_01_00_04_17.jpg
dso_01_01_00_04_17.jpg (57.98 KiB) Viewed 3442 times

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! In all the latest graphs, I try to have the yellow signal of the oscilloscope from the LED, and the green signal comes from the voltage divider, which is connected to the Tx pin of the controller. Now I will try to send a command from the controller to the esp-01 module that you wrote about. But I think it should look different: "AT+GMR\r\n" where the icons "\r\n" mean the end of the command.

Your graphics are beautiful, it would be nice if there was also a decryption of the signals to understand what he is drawing there.

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

When composing and sending a string

\r = Carriage Return (CR)
\n = New Line or Line Feed (LF)

These will be included in what the component sends out.

Your traces show pulses in excess of 4S (low) and 7S (high) so something is clearly wrong.

You mentioned earlier that you had a 328P chip. Perhaps try that as something is very wrong if you need the ESP component AND the UART component to get anything meaningful. This should not be the case.

Also, remember in my tests I am not actually connected to the esp8266, I'm only connected to the chip pins.

Regards

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: Download the program for the device via the Internet.

Post by mnf »

I have an atmega8 - I'll have a play with the UART component this evening - see if I can spot any issues?

Martin

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! The message was written before I had time to read your message! Now I have compiled a program for sending a text message ""AT+GMR\r\n", then I prescribed in it that it should be displayed on the display, and for some reason there was an abbreviated version ""AT+GMR". I did not receive a message about the firmware version, but I managed to notice that the LED still flashes 2 times as in the program, and there is a signal on the oscilloscope, only I need not to yawn, the text is displayed on lcd1602, but I did not receive the firmware version. The Tx pin has the same rectangular pulses as last time.
Attachments
flash_test_send_text_command.fcfx
(16.58 KiB) Downloaded 75 times

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Thank you Martin! This chip looks like it has something wrong... It's time to switch to atmega328p, I'll try to make a connection for it. But I will not disassemble the atmega8 board yet, in case you and we are lucky.

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! The attached figures show a general connection diagram without details.
Attachments
GEDC2943.JPG
GEDC2943.JPG (117.12 KiB) Viewed 3431 times
connecting LCD1602 and LED.JPG
connecting LCD1602 and LED.JPG (63.56 KiB) Viewed 3431 times

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: Download the program for the device via the Internet.

Post by mnf »

AT+GMR\r\n will just display as AT+GMR the \r\n are control characters and would do carriage return and new line (from the days of teletypes) and probably do nothing on the LCD display.

Martin

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good afternoon! Yes, it really is, only the command without these characters was displayed on the screen, although in principle they should have been displayed. After all, the uart bus doesn't care what text to transmit-signs or letters there and the lcd screen doesn't care what I wrote there either-there was a command to display this and that, he (the screen) decided that it was displaying, but it wasn't... It is the esp-01 module that perceives this text as a command.

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: Download the program for the device via the Internet.

Post by mnf »

What is displayed is correct... The control characters don't display.

Martin.

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Looking at your schematic, I think the esp "adapter" will be a cause of issues as that has other components on it too.

Only use that when you are connecting the esp8266 to your PC as you did in earlier posts. Don't have it connected at all to your esp8266 when your chip is trying to communicate with the esp8266. It will most likely mess up the communications.

I see you have used a socket for your chip. That's good for many reasons. It means you could very easily swap for the 328P to run some tests.

As Martin mentions, control characters won't display on your LCD.

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! I wanted to say about the adapter for esp-01, there is a board with tracks and holes for soldering and a connector for inserting the esp-01 module. There's nothing else there! I use it to avoid soldering the esp-01 module to my main board. You have confused it with a usb-ttl adapter board, they are almost the same from above, only the usb-ttl module has chips, a usb connector and so on.
Attachments
GEDC2944.JPG
GEDC2944.JPG (74.48 KiB) Viewed 3414 times

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: Download the program for the device via the Internet.

Post by mnf »

Have just tested an ATMega8 UART and seems to work okay.

Setup - I have the MCU on a breadboard connected to (and powered by) a programmer

Reset pin 1
mosi 17
miso 18
sck 19
VCC (I have 5v) 7
Gnd 8

First I did a 'flash test' - using d0 and all is good.
Then I hooked a FTDI converter to d0 and d1 (and Gnd this is essential) and added a UART component (Select Channel 1 - hardware uses d0 and d1)
I just printed "Hello\r\n" in a loop with a 1s delay and all is good at 9600 and 115200 baud.

I also tested software mode - and this worked AOK at 9600 baud but not 38400 (I'm using the internal 8MHz oscillator)

Will have a rummage for an esp8266.

Martin

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Okay Dokay, my mistake regarding the USB-TTL module.

Have a look at the attached. It doesn't show all connections necessary but does provide an outline of what we need to do.


Test Connections.pdf
(234.67 KiB) Downloaded 74 times


First diagram is just microcontroller to esp8266 module

Test-1
In this setup you can run your terminal program on your PC (ensure baud is correct) and monitor what is being sent to the esp8266.

Test-2
Same as above but we monitor what the eso8266 is sending to the microcontroller.

Hope this helps.

Martin - interested to see what you get with only the esp8266 component and not using the UART.

Regards

gilanetugila
Posts: 268
Joined: Thu Jul 30, 2020 2:01 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Download the program for the device via the Internet.

Post by gilanetugila »

Good evening! I have now conducted the same experiment, but with the atmega328p controller. Surprisingly, so far nothing has had to be soldered or added, thanks to my mentor :)! But the results are just as bad.: 1) does not show the firmware version 2) the LEDs are flashing, they are yellow in the picture.3) rectangular pulses from the Tx output instead of those from the Chipfire, they are indicated in green. 4) The ESP8266-01 module is connected. I will be able to check your versions on Sunday after 1 p.m.

For Martin: so if you just send some word (you had it "Hello\r\n"), then the controller does not freeze and the LED flashes alternately and this message is sent?
Attachments
Atmega328p_ESP-01_uart_FirmwareTest_flash_test.fcfx
(15.94 KiB) Downloaded 77 times
dso_01_01_00_04_10.jpg
dso_01_01_00_04_10.jpg (57.75 KiB) Viewed 3383 times
dso_01_01_00_06_23.jpg
dso_01_01_00_06_23.jpg (58.85 KiB) Viewed 3383 times

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Hi

Now you are using the 328P remove the UART component and all references to it, just leaving the esp component.

Connect your scope to the 328P chip, leave the esp completely disconnected and run the flash test / sendstring "U" test.

Regards

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: Download the program for the device via the Internet.

Post by mnf »

I can confirm that the MCU does write the appropriate data to the esp8266 using the component..

So initialise it writes
AT+CIPMUX=0

I then wrote in a loop
AT+GMR using the ESP8266::SendString macro.

But - I tested with the FTDI convertor.

I used hardware channel at 115200 (on 8MHz Atmega8 as before)

I totally failed to get my esp-01 board to work (it spat out a version string followed by 'invalid' at power on)
I tried a d1 mini and that spat out pages of memory dump before the WDT kicked in.

Will have to look back at Iain's info on re-flashing the firmware to the AT compatible mode.

Martin

chipfryer27
Valued Contributor
Valued Contributor
Posts: 784
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 186 times
Been thanked: 205 times

Re: Download the program for the device via the Internet.

Post by chipfryer27 »

Thanks Martin

You have just proved that the FC esp8266 component itself works with the ATMEGA8 and there is nothing inherently wrong in the FC / ATMEGA8 combination.

If gilanetugila can't get his ATMEGA8 to output anything useful using the esp8266 component without also having the UART component too, then there is something seriously wrong somewhere.

It may be worthwhile to reinstall FCv8 completely in case a file has somehow been corrupted, or as he has a 328P chip which is a "free chip" in FCv10 he starts using FCv10 (and I really think this is the better long term option).

To briefly recap.
  • Using a PC and a USB-TTL interface he can communicate directly with his esp8266 module, sending AT and receiving OK etc. This shows that his module is capable of acting upon the instructions being sent.

    After ensuring the correct clock speed was set in FC he could capture a one-second flash using his scope.

    Adding in a UART and a SendString component in the flash loop showed the correct sending of a "U"

    Removing the UART and replacing with the ESP8266 component didn't work, with unexpected scope traces.

    Returning the UART component to the chart, so both it and esp were present, did then allow the esp component to send "U". I really cannot explain this other than a possibly corrupted install.

    Attaching the actual esp8266 module to the microcontroller messes everything up with very unexpected scope traces. This step does suggest something wrong with connections or something unexpected is connected too as it works before the module is included. Using a different chip gives the same results
I don't think he will have much success until he can get his chip to output "U" without needing the UART present too. This suggests something wrong in his FC installation so before anything else he needs to address.

A complete reinstallation of FCv8 would be the first step (or move to v10 and use 328P chip).
Run a one-second flash test as before - check results
Include the UART to send out a "U" - check results
Remove UART and replace with esp8266 component to send out a "U" - check results.

Once the above steps are working, try Test-3 in the updated guide (attached). This is a direct connection between microcontroller and a PC running "Terminal" via a USB-TTL adapter. This test should capture whatever is being sent out by the chip and display on his PC.

Test Connections.pdf
(244.09 KiB) Downloaded 99 times

Basically, the root cause of the issues needs to be identified and then each step tested and verified before moving on and this includes ALL connections for the module too.

Regards

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: Download the program for the device via the Internet.

Post by mnf »

Yes - stepping up to v10 (and a m328p) would be a good idea.

Out of interest - I just recompiled using v8. It still 'works' in that the SendString still sends "AT+GMR" - but Initialise() just seems to send a newline.

I'll have a bit more of a play getting an esp8266 flashed and see if I can get the version info across.

Martin

Post Reply