How should I use the 'FTDI' to connect to Mizar32?

58 views
Skip to first unread message

Carlos Eduardo Garcia de Carvalho

unread,
Dec 19, 2012, 9:43:51 PM12/19/12
to miz...@googlegroups.com
Hello,

Hello,

I'm trying to use a USB-> Seril [1] based on FTDI chip. But it is not the DB9 connector.

I tried the following settings:
FTDI                   DB9 Serial Module of Mizar
GND---------------GND
RX-----------------TX
TX-----------------RX

and
GND---------------GND
RX-----------------RX
TX-----------------TX

In both attempts I could not use the elua shell.
I need to connect some other signal to work?

[]'s

Dado Sutter

unread,
Dec 20, 2012, 8:25:17 AM12/20/12
to miz...@googlegroups.com
If the terminal emulator (I know that you're using Putty, both under Windows7 and Ubuntu Linux) is set not to use Hardware Handshaking, these connections should be enough.
But let's hear the SimpleMachine guys and their sourcery to make it work :)

I add to this that we're all (==5 users and growing, of the first Brazilian Mizar32 User's Group) having problems with the Serial-to-USB cables Sergio kindly sent with the boards. Although they are identical to another one I had here (that works ok), these new units work erratically, being recognized by the OSs sometimes and sometimes they are simple not. 
Yes, windows users installed the drivers and they worked ok some (few) times. The drivers are reported as "working ok" by the Device Managers.

Other than that, the work is advancing nicely here and we count on you to keep up with this pace.


[]'s

Ciao
Dado





 

Dado Sutter

unread,
Dec 20, 2012, 10:24:28 AM12/20/12
to miz...@googlegroups.com
Hello guys,

On Wed, Dec 19, 2012 at 11:43 PM, Carlos Eduardo Garcia de Carvalho <carlosed...@ieee.org> wrote:
Reading the online instructions for the serial 232/485 board, I can read:

"A TTL to RS-232 levels shifter converter (like the Max 232) is used to pump the voltage from +-3V to +- 15V in 3 or 5 wires configuration" 
This configuration maybe done by those dip-switches on the board, let's read some more ..

Also, further down we read:
"Regarding configuration parameters, a common configuration (usually stored in a register) is 9600 8n1. That means for the serial port 9600 baud, 8 bits data, no parity bit, 1 stop bit"
If this is really the default for the Mizar32 communication, this would explain why we're having strange characters on the terminal, once we've been using it on a 115200 baud rate.

I'll invest the rest of the day in RTFM (read the fucking manual :) :)


[]'s

Best
Dado


 

Marcus Jansson

unread,
Dec 20, 2012, 10:32:12 AM12/20/12
to miz...@googlegroups.com
Hi,

My emails doesnt seem to end up on the mailing list. Grrr... So I possibly repost this now. There are two messages from me below. You will have to read it "backwards".

My misstake!
You cant use .elf for dfu-programmer, must use .hex. So I changed the file:
$ wget http://emcode.hopto.org/files/elua_lua_at32uc3a0256.hex.bz2

Also if things doesnt seem to run do:
$ dfu-programmer at32uc3a0256 reset
$ dfu-programmer at32uc3a0256 start

Regards,
Marcus

On Thu, Dec 20, 2012 at 2:33 PM, Marcus wrote:
Hello again Carlos,

I've been thinking some more. You probably want to recompile the elua
and flash it to your Mizar32 using the  dfu-programmer software. If
you have the original eLua still flashed, serial terminal might not be
working, due to USB etc. I'm uncertain what was shipped to you.

So you will want to clone the git repo and recompile. Something
similar to this on a GNU/Linux system:

$ git clone -b Mizar32 https://github.com/elua/elua
$ cd elua
$ scons board=mizar32
Hold down the SW2 switch on Mizar32, quickly press SW1, then let go of SW2.
$ dfu-programmer at32uc3a0256 erase
$ dfu-programmer at32uc3a0256 flash elua_lua_at32uc3a0256_
terminal_test.elf.bz2

or whatever you do to flash stuff onto Mizar32.
You can fetch a minimal unofficial copy that I just made. This one I
know works with the DB9 serial module, and should work just as fine
with your FTDI board:

$ wget http://emcode.hopto.org/files/elua_lua_at32uc3a0256.hex.bz2
$ bunzip2 elua_lua_at32uc3a0256_terminal_test.elf.bz2
Hold down the SW2 switch on Mizar32, quickly press SW1, then let go of SW2.
$ dfu-programmer at32uc3a0256 erase
$ dfu-programmer at32uc3a0256 flash elua_lua_at32uc3a0256_terminal_test.elf.bz2

Then run a terminal program at 115200 baud, 8N1 and set the correct
serial port for the FTDI chip. Reset Mizar32 and hit enter to get the
eLua prompt. Insert a SD-card with some files, enter the ls command
and you see the SD-card directory.

Does this work ok for you?

Too bad about the USB<->Serial cables. Does disconnecting/Reconnecting
help at all? Does connecting to a USB-hub help? Does lowering
communication speed help, e.g. 9600 baud?
Regards,
Marcus

On 12/20/12, Marcus wrote:
> Hello Carlos,
>
> Oh, I think you should not connect the FTDI board to the DB9 serial module!
> When using the FTDI module you should remove the DB9 serial module.
> You should connect the FTDI module directly to Mizar32 pin BUS4.2 and
> BUS4.3, as well as to +5V and GND.
>
> From the looks of it I would GUESS that a crossed-over connection
> would be correct.
>
> FTDI   Mizar32
> RXI --- TX (BUS4.3)
> TXO --- RX (BUS4.2)
> 5V ---- VCC5 (BUS5.1)
> GND --- GND (BUS4.1)
>
> Check the schematics.
>
> Did you see any output from eLua on the DB9/FTDI port?
> Is it just input that is not working?
> Is your baudrate set correctly?
> Which model of Mizar32 are you using A, B or C?
>
> Hope this gives you a hint. Please tell if it works better or not.
> Regards,
> Marcus

Marcus Jansson

unread,
Dec 20, 2012, 10:51:52 AM12/20/12
to miz...@googlegroups.com
Dado,

The default serial baudrate for Mizar32/eLua should be 115200 baud, 8N1, no handshakes.
As I mentioned in previous message, you should not use the DB9 Serial module in combination with the FTDI.
(The dipswitches, when using DB9 Serial module for RS232 communication should be: All OFF (up), except the 1, 2 and 3 of the dipswitch closest to the EEPROM chip). 

Possibly by connecting the DB9 connector lines the FTDI might have been damaged by the +-15V. Lets hope for the best.

I have also had cases with strange chars on the terminal. Resetting the terminal, reconnecting the USB<->Serial converter, resetting Mizar32 etc have helped. But I have never figured out the exact cause for the errors. I suspect the USB<->Serial converter. Finding an old desktop computer with RS232 connector might be helpful for debugging to eliminiate the USB<->Serial converter.
Regards,
Marcus

Carlos Eduardo "Mascote" Garcia de Carvalho

unread,
Dec 20, 2012, 10:59:04 AM12/20/12
to miz...@googlegroups.com
Marcus, thanks for the help. Dado has accompanied me on these issues.

I hope I have not burned the FTDI and tonight will test without RS-232 module.

Regards

---
Carlos Eduardo "Mascote" Garcia de Carvalho
"Reconhece-o em todos os teus caminhos, e ele endireitará as tuas veredas." Provérbios 3.6
(21) 8125-1737
Skype: carloseduardo.gc

Dado Sutter

unread,
Dec 20, 2012, 11:19:02 AM12/20/12
to miz...@googlegroups.com
Yes, thank you very much Marcus. Now we're getting your messages on the list.

According to the Mizar32 serial module, there is no need for a null-modem (crossed) cable so, in theory, RX should be connected to RX and TX to TX.

Ok for the default 115200 8n1 no-handshaking defaults, thanks. It was also clear further down on the manual.

Is there a reason why you've used 4 dip switches to select RS-232 and 4 more for RS485? I don't know (yet) if the switches have other functions, otherwise only 1 switch or jumper seems to be enough. 
I need 485 for a project here, so I might try to help adding it to eLua one of these days too.

Yes, it is very strange what is happening with the USB-serial cables. For at least an hour yesterday, we had 4 of them working at the same time, both in Windows and in Linux. When people got back home they (the cables :) seem to gave up working again.

I also hope and plan to have some more time to work on these issues later today.

Thank you again for the help (!!!). We want to be quick on this starting kick-off, so the new Mizar32 User Group can start to work on real project, as well as helping on testing and enhancing the IDE (great work guys!)

Thanksssssssssss
Dado

Marcus Jansson

unread,
Dec 20, 2012, 12:00:20 PM12/20/12
to miz...@googlegroups.com
Dado,

Correct, when using the Mizar32 Serial module you use a straigth cable. But when hooking up the FTDI board you have to find out if you need a crossed or straight. It is not clear from the FTDI board and always a little confusing when talking about RX or TX. Never know which side they mean, serial side or USB side? :)

The RS232 and RS485 is perhaps not meant to run at the same time, using the same RX/TX pins on the AVR32 chip. So when you use RS232, you might want to set all RS485 dipswitches OFF (The 4 switches to the "left"). And when using RS485 you set all RS232 dipswitches OFF (the 4 switches to the "right", closer to the EEPROM). Otherwise there might be conflicts from the two chips, MAX232 (U3) and MAX485 (U2) going in to AVR32. Only three of the dipswitches are actually used. Consult the schematics for the Serial module:
http://mizar32.googlecode.com/files/Serial_interface_1.0_schematic.pdf
I think, for example, that you can do a setup where you only receive from RS485 but send on both RS485 and RS232 at the same time. Receiving from both RS232 and RS485 will produce very interesting results from time to time. ;)

Try to figure out which procedure of resetting, sequence of attaching cables and powering up Mizar etc you need to get the USB<->serial convertors work. There might be something magical you have to do everytime. Start with everything pulled out, then attach one cable, start terminal prog, set dipswitches correctly, start mizar. If it doesnt work, pull everything out and redo in another sequence.

I have had one USB<->Serial converter for almost 10 years, it worked perfectly until last month when suddenly started to act strange. Another brand new USB<->Serial needs to be disconnected/reconnected every now and then. Very fishy. Another convertor I have doesnt handle the parity bit correctly. So watch out for that too.

Regards,
Marcus

Marcus

unread,
Dec 20, 2012, 8:33:51 AM12/20/12
to miz...@googlegroups.com
Hello again Carlos,

I've been thinking some more. You probably want to recompile the elua
and flash it to your Mizar32 using the dfu-programmer software. If
you have the original eLua still flashed, serial terminal might not be
working, due to USB etc. I'm uncertain what was shipped to you.

So you will want to clone the git repo and recompile. Something
similar to this on a GNU/Linux system:

$ git clone -b Mizar32 https://github.com/elua/elua
$ cd elua
$ scons board=mizar32
Hold down the SW2 switch on Mizar32, quickly press SW1, then let go of SW2.
$ dfu-programmer at32uc3a0256 erase
$ dfu-programmer at32uc3a0256 flash elua_lua_at32uc3a0256_terminal_test.elf.bz2

or whatever you do to flash stuff onto Mizar32.
You can fetch a minimal unofficial copy that I just made. This one I
know works with the DB9 serial module, and should work just as fine
with your FTDI board:

$ wget http://emcode.hopto.org/files/elua_lua_at32uc3a0256_terminal_test.elf.bz2
$ bunzip2 elua_lua_at32uc3a0256_terminal_test.elf.bz2
Hold down the SW2 switch on Mizar32, quickly press SW1, then let go of SW2.
$ dfu-programmer at32uc3a0256 erase
$ dfu-programmer at32uc3a0256 flash elua_lua_at32uc3a0256_terminal_test.elf.bz2

Then run a terminal program at 115200 baud, 8N1 and set the correct
serial port for the FTDI chip. Reset Mizar32 and hit enter to get the
eLua prompt. Insert a SD-card with some files, enter the ls command
and you see the SD-card directory.

Does this work ok for you?

Too bad about the USB<->Serial cables. Does disconnecting/Reconnecting
help at all? Does connecting to a USB-hub help? Does lowering
communication speed help, e.g. 9600 baud?
Regards,
Marcus

On 12/20/12, Marcus <cmp...@gmail.com> wrote:
> Hello Carlos,
>
> Oh, I think you should not connect the FTDI board to the DB9 serial module!
> When using the FTDI module you should remove the DB9 serial module.
> You should connect the FTDI module directly to Mizar32 pin BUS4.2 and
> BUS4.3, as well as to +5V and GND.
>
> From the looks of it I would GUESS that a crossed-over connection
> would be correct.
>
> FTDI Mizar32
> RXI --- TX (BUS4.3)
> TXO --- RX (BUS4.2)
> 5V ---- VCC5 (BUS5.1)
> GND --- GND (BUS4.1)
>
> Check the schematics.
>
> Did you see any output from eLua on the DB9/FTDI port?
> Is it just input that is not working?
> Is your baudrate set correctly?
> Which model of Mizar32 are you using A, B or C?
>
> Hope this gives you a hint. Please tell if it works better or not.
> Regards,
> Marcus
>
>
> On 12/20/12, Carlos Eduardo Garcia de Carvalho

Marcus

unread,
Dec 20, 2012, 6:52:53 AM12/20/12
to miz...@googlegroups.com
Hello Carlos,

Oh, I think you should not connect the FTDI board to the DB9 serial module!
When using the FTDI module you should remove the DB9 serial module.
You should connect the FTDI module directly to Mizar32 pin BUS4.2 and
BUS4.3, as well as to +5V and GND.

From the looks of it I would GUESS that a crossed-over connection
would be correct.

FTDI Mizar32
RXI --- TX (BUS4.3)
TXO --- RX (BUS4.2)
5V ---- VCC5 (BUS5.1)
GND --- GND (BUS4.1)

Check the schematics.

Did you see any output from eLua on the DB9/FTDI port?
Is it just input that is not working?
Is your baudrate set correctly?
Which model of Mizar32 are you using A, B or C?

Hope this gives you a hint. Please tell if it works better or not.
Regards,
Marcus


On 12/20/12, Carlos Eduardo Garcia de Carvalho
<carlosed...@ieee.org> wrote:

Nuccio Raciti

unread,
Dec 21, 2012, 5:33:38 AM12/21/12
to miz...@googlegroups.com
Hi Carlos,


I did not understand if you have solved the problem, but if you have not
done the first thing you should connect with RX and TX on FTDI module
with the aim of understanding if it still works....
Your FTDI module works at TTL level (0-5V) while the RS232C interface
(the one implemented by the Mizar32 Serial module works with -12/+12v in
accord with the RS232C standard), so the FTDI module may have been
damaged... (http://en.wikipedia.org/wiki/RS-232).
Bridging rx and tx and using a terminal emulator (putty is good) you
should see any character you press on keyboard back on the terminal...

If the TTL module works, you should connect three wires directly on
Mizar32 (without the Serial Module):

FTDI Mizar32 connector BUS_HALF_RIGHT_UP
GND --- GND (pin 1 or 14)
TXO --- RX (pin 3) also named UART0_RX
RXI --- TX (pin 4) also named UART0_TX


I hope it helps,

Nuccio







Carlos Eduardo "Mascote" Garcia de Carvalho

unread,
Dec 21, 2012, 5:40:58 AM12/21/12
to mizar32
I have not resolved yet. I believe the FTDI did not burn but will test connecting the TX to RX.

Yesterday I tried to make the connection as you proposed and still did not work. But I did not change the firmware Mizar32

Thanks


Carlos.


---
Carlos Eduardo "Mascote" Garcia de Carvalho
"Reconhece-o em todos os teus caminhos, e ele endireitará as tuas veredas." Provérbios 3.6
(21) 8125-1737
Skype: carloseduardo.gc


Nuccio Raciti

unread,
Dec 21, 2012, 6:04:47 AM12/21/12
to miz...@googlegroups.com
Ok, let us know...

Nuccio

Carlos Eduardo "Mascote" Garcia de Carvalho

unread,
Feb 20, 2013, 10:45:46 PM2/20/13
to mizar32
Marcus,

today I'm trying to do this steps on a Windows 7 64bits.

You can send me a elf image? Recalling the thread, after firmware flashing I need to able to connect to Mizar32 only by USB cable (without RSR232 converter).

Thank your help!


[]'s



---
Carlos Eduardo "Mascote" Garcia de Carvalho
"Reconhece-o em todos os teus caminhos, e ele endireitará as tuas veredas." Provérbios 3.6
(21) 8125-1737
Skype: carloseduardo.gc


Carlos Eduardo "Mascote" Garcia de Carvalho

unread,
Feb 20, 2013, 10:57:53 PM2/20/13
to mizar32
I try with the hex file above and the batchisp returns:

C:\Mizar32\firmware test marcus>batchisp -device at32uc3a0256 -hardware usb -ope
ration erase f memory flash blankcheck loadbuffer elua_lua_at32uc3a0256.hex veri
fy start reset 0
Running batchisp 1.2.5 on Thu Feb 21 00:56:50 2013



AT32UC3A0256 - USB - USB/DFU


Device selection....................... PASS
Hardware selection..................... PASS
Opening port........................... PASS
Reading Bootloader version............. PASS    1.0.3
Erasing................................ PASS
Selecting FLASH........................ PASS
Blank checking......................... PASS    0x00000 0x3ffff
Parsing HEX file....................... PASS    elua_lua_at32uc3a0256.hex
Verifying memory....................... FAIL    Verify device fail at 0x02000
(A)bort, (R)etry, (I)gnore ? a

ISP done.

Can I choose Ignore?

[]'s

---
Carlos Eduardo "Mascote" Garcia de Carvalho
"Reconhece-o em todos os teus caminhos, e ele endireitará as tuas veredas." Provérbios 3.6
(21) 8125-1737
Skype: carloseduardo.gc


Marcus

unread,
Feb 22, 2013, 4:17:24 AM2/22/13
to miz...@googlegroups.com
Hi Carlos,

Sorry for late answer. You probably already resolved this problem. I
never used batchisp on win, so I dont the answer. I would imagine it
is safe to choose ignore. since the "Erasing" was reported "Pass" I
would imagine the bootloader is intact. Keeping the bootloader intect
is the only thing to worry about when using dfuprogrammer/batchisp
types of programs.

Regards,
Marcus

On 2/21/13, Carlos Eduardo "Mascote" Garcia de Carvalho
>>>> **terminal_test.elf.bz2
>>>>
>>>> or whatever you do to flash stuff onto Mizar32.
>>>> You can fetch a minimal unofficial copy that I just made. This one I
>>>> know works with the DB9 serial module, and should work just as fine
>>>> with your FTDI board:
>>>>
>>>> $ wget
>>>> http://emcode.hopto.org/files/**elua_lua_at32uc3a0256.hex.bz2<http://emcode.hopto.org/files/elua_lua_at32uc3a0256_terminal_test.elf.bz2>
>>>> $ bunzip2 elua_lua_at32uc3a0256_**terminal_test.elf.bz2
>>>> Hold down the SW2 switch on Mizar32, quickly press SW1, then let go of
>>>> SW2.
>>>> $ dfu-programmer at32uc3a0256 erase
>>>> $ dfu-programmer at32uc3a0256 flash elua_lua_at32uc3a0256_**
>>>> terminal_test.elf.bz2
> --
> You received this message because you are subscribed to the Google Groups
> "Mizar32" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mizar32+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

Carlos Eduardo "Mascote" Garcia de Carvalho

unread,
Feb 22, 2013, 5:49:33 AM2/22/13
to mizar32
Thanks Marcus,

I had not resolved yet.

I choose Ignore and the output is:
AT32UC3A0256 - USB - USB/DFU


Device selection....................... PASS
Hardware selection..................... PASS
Opening port........................... PASS
Reading Bootloader version............. PASS    1.0.3
Erasing................................ PASS
Selecting FLASH........................ PASS
Blank checking......................... PASS    0x00000 0x3ffff
Parsing HEX file....................... PASS    elua_lua_at32uc3a0256.hex
Verifying memory....................... FAIL    Verify device fail at 0x02000
(A)bort, (R)etry, (I)gnore ? i

Starting Application................... PASS    RESET   0

Summary:  Total 10   Passed 9   Failed 1


Then I try to connect FTDI using
FTDI   Mizar32
RXI --- TX (BUS4.3)
TXO --- RX (BUS4.2)
5V ---- VCC5 (BUS5.1)
GND --- GND (BUS4.1)


and try to connect with Putty but I didn't see anything. 
I try to change and put RXI -- RX, TXO -- TX and then nothing happens again. :(


How this board dosen't work like Arduino? How I can use USB connecti



Ps: My guess for the converter PL-2303 is not working is incompatibility between him and my USB controller (Netbook, Acer AO 722, AMD usb host)



---
Carlos Eduardo "Mascote" Garcia de Carvalho
"Reconhece-o em todos os teus caminhos, e ele endireitará as tuas veredas." Provérbios 3.6
(21) 8125-1737
Skype: carloseduardo.gc


Carlos Eduardo "Mascote" Garcia de Carvalho

unread,
Feb 22, 2013, 5:56:57 AM2/22/13
to mizar32
Sorry for new e-mail, I accidentally pressed send.

How this board dosen't work like Arduino? 
How I can use USB connection to put new firmware but can not use it to connect to the terminal?

[]'s


---
Carlos Eduardo "Mascote" Garcia de Carvalho
"Reconhece-o em todos os teus caminhos, e ele endireitará as tuas veredas." Provérbios 3.6
(21) 8125-1737
Skype: carloseduardo.gc


Reply all
Reply to author
Forward
0 new messages