Author Topic: [FIXED!] Weird Serial/WiFi issues  (Read 47133 times)

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #30 on: January 22, 2014, 10:31:13 am »
Oh well, maybe digistump has some more ideas, but still, thank you very much for your help gogol.

@balin what do you mean with Serial0? Just Serial?

balin

  • Newbie
  • *
  • Posts: 11
Re: Weird Serial/WiFi issues
« Reply #31 on: January 22, 2014, 11:22:21 am »


no these pins are accessable through the Serial0 command so i just replaced all Serial commands with the Serial0 and used USB to RS232 TTL UART Konverter Module.

The Konverter looks something like that:
« Last Edit: January 22, 2014, 11:27:19 am by balin »

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #32 on: January 22, 2014, 11:29:20 am »
Thats a really good idea, even have one of those here  ;D

Settings for Board/Programmer/... are all the same?

balin

  • Newbie
  • *
  • Posts: 11
Re: Weird Serial/WiFi issues
« Reply #33 on: January 22, 2014, 11:30:31 am »
yes i changed nothing else. used digix standart leave programmer where it was and just replaced the Serial commands.

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #34 on: January 22, 2014, 11:58:08 am »
This is the converter i have got here:



So i just connect GND to GND, 5V to 5V, TX to TX, RX to RX and RESET to RESET?
Whats with that unlabeled pin? Does the 5V work with the 3.3V DigiX?

(dont want to fry anything)

balin

  • Newbie
  • *
  • Posts: 11
Re: Weird Serial/WiFi issues
« Reply #35 on: January 22, 2014, 12:00:20 pm »
i only used rx (rx to rx) and tx (tx to tx) the konverter should get the power over usb maybe connect gnd (gnd to gnd) also ^^.
« Last Edit: January 22, 2014, 12:05:34 pm by balin »

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #36 on: January 22, 2014, 01:04:55 pm »
Are you uploading the sketch directly or via the converter? cant get it to work oO

balin

  • Newbie
  • *
  • Posts: 11
Re: Weird Serial/WiFi issues
« Reply #37 on: January 22, 2014, 02:06:32 pm »
im uploading the sketch over the usbserial port.

but to get debug infos and so on im using the Serial0 port, cause my serialusb dont work.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Weird Serial/WiFi issues
« Reply #38 on: January 23, 2014, 01:14:47 am »
You should not connect this adapter direct to the board, as that has true 5V on RX and TX, because RX and TX are PINs from 8U2
http://arduino.cc/en/Main/USBSerial
If you have the level-shifter, that should do it, maybe digistump will tell something to it!

That adapter, balin showed, has 3.3V on the serial communication lines.

Those adapters use an CP2104 (which is the successor of the CP2102), there are other adapters out, using the FT232R, Maxim and other companies have also some of those out.
The cheap (slow) adapters are available via ebay aliexpress and others for about $2-$4.

If you wish to spent little more money, have a look at the FT232H http://digistump.com/board/index.php/topic,1127.0.html
That device works a multiple devices in one. Its a normal USB-Serial to TTL (like the cheap adapters above) and also and HIGH-speed-serial protocol adapter, speaking native I2C, SPI, JTAG and others.

The big difference between the CORE-USB-to-serial-TTL adapters and the Arduino-Adapter is as following:

The CORE adapters are just a TTL-based UARTs, running the TTL-level protocol on the pins:

I hope, that the few german words in the picture above are understandable for all readers.

The Arduino-Adapter works different:  The 8U2 (or 16U2 ...) connects with the built-in USB interface and simulates an virtual COM-Port on top of the USB protocol.
This happens over the Abstract Control Model (ACM) , which is defined in the USB Communication Device Class (CDC). Electrical communication is here USB.

On the atmel-CPU is a program running like a proxy:  It accepts data from the virtual USB-COM-Port and output that to the serial port (which is therefore 5V) and via versa.
The proxy-program has some specialities:  For example, when it discovers that the virtual com port is opened and closed with 9600 baud, it triggers the reset of the SAM3X.
The 16U2 on the Arduino DUE works slightly different, as this triggers not only RESET but also ERASE. 

Those Arduinos, which have an FTDI-chip on board, are triggering the reset via the DTR-signal, which is connected via an 100nF capacitor to the reset-line, which is itself pulled high via an resistor.

To avoid the native port programming, you have the following possibilities:

Use an cheap USB-TTL-serial adapter. In that case you have to press ERASE/RESET before each upload yourself

Use something like the above mentioned 8u2/16u2 solution. Make sure that the 8u2/16u2 are running with 3.3V and adapt the Arduino-Firmware.
Unfortunatley the ERASE-Pin is not connected to any breakout-PIN (http://digistump.com/board/index.php/topic,1216.msg5818.html#msg5818)

The third possibility is working via JTAG, which is one task, I am working currently on (http://digistump.com/board/index.php/topic,1275.0.html)






balin

  • Newbie
  • *
  • Posts: 11
Re: Weird Serial/WiFi issues
« Reply #39 on: January 23, 2014, 02:50:43 am »
Ouh damn i didnt look on the voltage. but gogol is right this one uses 5V on rx tx lvl

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #40 on: January 23, 2014, 10:20:31 am »
The FT232H sounds awesome but also awfully complicated as i don't want to break anything and have no knowledge about JTAG at all.

Maybe digistump (or someone else) can find a solution so I can just use the native USB port or maybe you could create a noob-tutorial in the future on how to use the FT232H with the DigiX/Digispark.

For now i'll just wait until my new SSD arrives and see if it works with a fresh windows installation.

balin

  • Newbie
  • *
  • Posts: 11
Re: Weird Serial/WiFi issues
« Reply #41 on: January 23, 2014, 10:47:08 am »
tell me if the native serial over usb port is working then. cant get it to work on my side either...

Kaeltis

  • Newbie
  • *
  • Posts: 27
Re: Weird Serial/WiFi issues
« Reply #42 on: January 27, 2014, 01:33:20 pm »
After a complete reinstallation of Win 8.1 x64 I still have the same problems, also, "listComPorts.exe" is still crashing.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Weird Serial/WiFi issues
« Reply #43 on: January 27, 2014, 11:57:58 pm »
Do you have the chance, to boot a linux rescue system from CD/DVD/USB-stick on that box?




digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Weird Serial/WiFi issues
« Reply #44 on: January 28, 2014, 12:14:44 am »
Given the reply here: https://github.com/arduino/Arduino/issues/1818 - that you noted it seems listComPorts.exe doesn't play a part in this because it is not in use by the IDE (we don't do anything different than the Due Native Port when it comes to the USB stuff - we only changed the VID/PID)

So it seems like the root of this is the Arduino IDE COM port enumeration code - does that sound right? - which leaves me at a loss because I can't reproduce this issue to even try to fix it (tried 3 machines running 8.1).