Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - whileLoop

1
General discussion / Re: Anyone playing with the FT311D yet?
I used the OpenAccessoryTest project from here: http://www.duinodroid.com/android. Look for OpenAccessoryTest.zip
Once you import the project change the strings in res/xml/accessory_filter.xml to match the ones sent by the ft311. Then replace the contents of the method sendMessageToArduino with ft311 code.

This code is more or less copied from the FTDI example code.

Code: [Select]

/*configure data*/
public void configPort(byte configOutMap, byte configINMap){
byte[] writeusbdata = new byte[4];

writeusbdata[0] = 0x11;
writeusbdata[1] = 0x00;
writeusbdata[2] = configOutMap;
writeusbdata[3] = configINMap;


try {
// if(mOutputStream != null){
mOutputStream.write(writeusbdata);
// }
} catch (Exception e) {
log("Send failed: " + e.getMessage());
}

}

/*write port*/
public void writePort(byte portData){
byte[] writeusbdata = new byte[4];

writeusbdata[0] = 0x13;
writeusbdata[1] = portData;
writeusbdata[2] = 0x00;
writeusbdata[3] = 0x00;

try {
// if(mOutputStream != null){
mOutputStream.write(writeusbdata, 0,4);
// }
} catch (Exception  e) {
log("Send failed: " + e.getMessage());
}
}


2
General discussion / Re: Anyone playing with the FT311D yet?
Solid red LED means the device is connected properly. The code provided by FTDI is a bit sloppy and possibly broken. I Will post my code later when I get home. When you connect your phone, it may prompt you about connection type depending on the version of android on the phone. You want to connect as a media device (MTP), same as a you would if were to connect as a USB storage device. If the connection is successful the top bar on the android should say something like "Connected to USB Accessory". At this point if there are any programs with intent filters matching the string descriptors sent by the dev board, that program should automatically open, otherwise a popup will appear saying there are no matching programs.

Also, make sure you power the board with a proper power supply. The board will supply 500mA to the phone and consume another 100mA so you need to be able to supply at least that much current without getting loaded down. A standard computer USB port will not be able to handle that load.
3
General discussion / Anyone playing with the FT311D yet?
I got the eval board from FTDI, and got it working in GPIO mode pretty quickly. Now I'm working on I2C and having some issues (nothings ever easy right).

Anyone else out there interested in this chip?
4
AVRDude / Cant read ATmega32u4 with AVRDUDE (verbose output attached)
Hello All,

When attempting to read a ATmega32u4 with a buspirate through AVRDUDE I see that everything is ok until the last command at which point the ATmega returns
"0x04 0xd3 0x00 0x00" instead of "0x00 0x00 0x53 0x00".

Does anyone know what this response means?

I have attached the verbose output from the failed read operation on the ATmega32u4, and the output from a successful read from a ATmega328p.

Snippet from the last part of the failed read operation:
avrdude: buspirate_send_bin():
0xac 0x53 0x00 0x00
avrdude: buspirate_recv_bin():
0x04 0xd3 0x00 0x00
avrdude: initialization failed, rc=-2
Double check connections and try again, or use -F to override
this check.

Thanks for the help!
6
AVRDude / ATMEGA328p Full Swing Oscilliator Problems (rc=-2)
Hello All,

I recently tried to use my atmega328 with a 20Mhz crystal.

I set to fuse bits using the following avrdude command.

avrdude -c buspirate -p m328p -P com6 -e -u -U lock:w:0x3F:m -U efuse:w:0x07:m -U hfuse:w:0x09:m -U lfuse:w:0xE7:m

then i tried to read using

avrdude -c buspirate -p m328p -P com6 -v -v

and got a rc=-2 error, so I figured my oscillator wasn't working properly, so I placed the chip in my Arduino Uno board, which has a known good 16Mhz oscillator but it still didn't work.

I have included the verbose output here:

Code: [Select]
avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
        Copyright (c) 2000-2005 Brian Dean,
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "C:WinAVR-20100110binavrdude.conf"

        Using Port                    : com6
        Using Programmer              : buspirate
        AVR Part                      : ATMEGA328P
        Chip Erase delay              : 9000 us
        PAGEL                        : PD7
        BS2                          : PC2
        RESET disposition            : dedicated
        RETRY pulse                  : SCK
        serial program mode          : yes
        parallel program mode        : yes
        Timeout                      : 200
        StabDelay                    : 100
        CmdexeDelay                  : 25
        SyncLoops                    : 32
        ByteDelay                    : 0
        PollIndex                    : 3
        PollValue                    : 0x53
        Memory Detail                :

                                  Block Poll              Page                      Polled
          Memory Type Mode Delay Size  Indx Paged  Size  Size #Pages MinW  MaxW  ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          eeprom        65    5    4    0 no      1024    4      0  3600  3600 0xff 0xff
          flash        65    6  128    0 yes    32768  128    256  4500  4500 0xff 0xff
          lfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          efuse          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          lock          0    0    0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0    0    0    0 no          1    0      0    0    0 0x00 0x00
          signature      0    0    0    0 no          3    0      0    0    0 0x00 0x00

        Programmer Type : BusPirate
        Description    : The Bus Pirate

Detecting BusPirate...
avrdude: buspirate_send_bin():
  0x23 0x0a
avrdude: buspirate_readline(): #
avrdude: buspirate_readline(): RESET
avrdude: buspirate_readline():
**
avrdude: buspirate_readline(): Bus Pirate v3a
**  Bus Pirate v3a
avrdude: buspirate_readline(): Firmware v5.10 (r559)  Bootloader v4.4
**  Firmware v5.10 (r559)  Bootloader v4.4
avrdude: buspirate_readline(): DEVID:0x0447 REVID:0x3043 (24FJ64GA002 B5)
**  DEVID:0x0447 REVID:0x3043 (24FJ64GA002 B5)
avrdude: buspirate_readline(): http://dangerousprototypes.com
**  http://dangerousprototypes.com
avrdude: buspirate_readline(): HiZ>
**
BusPirate: using BINARY mode
avrdude: buspirate_send_bin():
  0x00 0x00 0x00 0x00  0x00 0x00 0x00 0x00
  0x00 0x00 0x00 0x00  0x00 0x00 0x00 0x00
  0x00 0x00 0x00 0x00 
avrdude: buspirate_recv_bin():
  0x42 0x42 0x49 0x4f  0x31
BusPirate binmode version: 1
avrdude: buspirate_send_bin():
  0x01
avrdude: buspirate_recv_bin():
  0x53 0x50 0x49 0x31 
BusPirate SPI version: 1
avrdude: buspirate_send_bin():
  0x4b
avrdude: buspirate_recv_bin():
  0x01
avrdude: buspirate_send_bin():
  0x60
avrdude: buspirate_recv_bin():
  0x01
avrdude: buspirate_send_bin():
  0x8a
avrdude: buspirate_recv_bin():
  0x01
avrdude: buspirate_send_bin():
  0x4a
avrdude: buspirate_recv_bin():
  0x01
avrdude: buspirate_send_bin():
  0x13
avrdude: buspirate_recv_bin():
  0x01
avrdude: buspirate_send_bin():
  0xac 0x53 0x00 0x00 
avrdude: buspirate_recv_bin():
  0x00 0x00 0x00 0x00 
avrdude: initialization failed, rc=-2
        Double check connections and try again, or use -F to override
        this check.

avrdude: buspirate_send_bin():
  0x40
avrdude: buspirate_recv_bin():
  0x01
avrdude: buspirate_send_bin():
  0x00
avrdude: buspirate_send_bin():
  0x0f
avrdude: buspirate_recv_bin():
  0x42 0x42 0x49 0x4f  0x31 0x01 0x0d 0x0a
  0x42
avrdude: buspirate_recv_bin():
  0x75 0x73 0x20 0x50  0x69 0x72 0x61 0x74
  0x65
avrdude: buspirate_recv_bin():
  0x20 0x76 0x33 0x61  0x0d 0x0a 0x46 0x69
  0x72
avrdude: buspirate_recv_bin():
  0x6d 0x77 0x61 0x72  0x65 0x20 0x76 0x35
  0x2e
avrdude: buspirate_recv_bin():
  0x31 0x30 0x20 0x28  0x72 0x35 0x35 0x39
  0x29
avrdude: buspirate_recv_bin():
  0x20 0x20 0x42 0x6f  0x6f 0x74 0x6c 0x6f
  0x61
avrdude: buspirate_recv_bin():
  0x64 0x65 0x72 0x20  0x76 0x34 0x2e 0x34
  0x0d
avrdude: buspirate_recv_bin():
  0x0a 0x44 0x45 0x56  0x49 0x44 0x3a 0x30
  0x78
avrdude: buspirate_recv_bin():
  0x30 0x34 0x34 0x37  0x20 0x52 0x45 0x56
  0x49
avrdude: buspirate_recv_bin():
  0x44 0x3a 0x30 0x78  0x33 0x30 0x34 0x33
  0x20
avrdude: buspirate_recv_bin():
  0x28 0x32 0x34 0x46  0x4a 0x36 0x34 0x47
  0x41
avrdude: buspirate_recv_bin():
  0x30 0x30 0x32 0x20  0x42 0x35 0x29 0x0d
  0x0a
avrdude: buspirate_recv_bin():
  0x68 0x74 0x74 0x70  0x3a 0x2f 0x2f 0x64
  0x61
avrdude: buspirate_recv_bin():
  0x6e 0x67 0x65 0x72  0x6f 0x75 0x73 0x70
  0x72
avrdude: buspirate_recv_bin():
  0x6f 0x74 0x6f 0x74  0x79 0x70 0x65 0x73
  0x2e
avrdude: buspirate_recv_bin():
  0x63 0x6f 0x6d 0x0d  0x0a 0x48 0x69 0x5a
  0x3e
BusPirate is back in the text mode

avrdude done.  Thank you.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.05132353168session_write_close ( )...(null):0
20.05172484744ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.05172485520Database_MySQL->query( ).../DatabaseHandler.php:119
40.09652624240Database_MySQL->error( ).../Db-mysql.class.php:273