Show Posts
Pages: [1] 2 3 ... 9
1  Using Arduino / Installation & Troubleshooting / Re: 1.5.6r2 SEES Leonardo, but still can't program it. on: September 28, 2014, 02:58:00 am
The list of things you rant against becomes quite impressive: ubuntu, leonardo, micro, their bootloaders, the people who wrote their bootloaders...

Please just provide the logs tf68 and I asked for. Without that we won't be able to help you.

Edit: extra simple question: if you press the reset button , does the  L led blink (rather fade in/out) about 14 times?
2  Using Arduino / Installation & Troubleshooting / Re: 1.5.6r2 SEES Leonardo, but still can't program it. on: September 26, 2014, 03:17:00 pm
tf68 handed you a perfect test to see  whether there still is a working bootloader in your leonardo (It might got corrupted) and it will also show any access right problems. You should really try that out first.

The order tf68  describes is important:

- After you plug in the Leonardo, two things can happen. The oldest version of the bootloader starts waiting some time for avrdude to upload a new sketch (L led starts fading in and out for some time).  The newer version notices this is a power-on reset and immedeately jumps to the sketch already in the flash.

- After you press reset, the bootloader starts and waits for some time for avrdude to send a new sketch.

This is the time to send the command described by tf68 (I second tf68: post the verbatim output here)

If the test fails, you can also post the last 10 lines or so of the dmesg command.
If it works, dmesg shows something like this:

[  420.795436] usb 2-1.2: new full-speed USB device number 7 using ehci_hcd
[  420.890237] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device         <--------- this is the bootloader
[  423.153948] usb 2-1.2: USB disconnect, device number 7
[  423.353056] usb 2-1.2: new full-speed USB device number 8 using ehci_hcd
[  423.448985] cdc_acm 2-1.2:1.0: This device cannot do calls on its own. It is not a modem.
[  423.449043] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device           <-------- this is the sketch already in the flash
[  423.451750] input: Arduino LLC Arduino Leonardo as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.2/input/input17
[  423.452368] generic-usb 0003:2341:8036.0006: input,hidraw3: USB HID v1.01 Mouse [Arduino LLC Arduino Leonardo] on usb-0000:00:1d.0-1.2/input2

3  Development / Suggestions for the Arduino Project / Re: Suggestion: A Better Leonardo Bootloader. on: September 26, 2014, 01:47:51 pm
I have used my Leonardo on kubuntu 10.04, on 12.04 LTS and on debian Wheezy. It proved very reliable on all of them.

I just noticed your thread "Re: 1.5.6r2 SEE  Leonardo, but still can't program it." I think you should investigate the original problem more systematically. I'll post some suggestions over there.
4  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: September 12, 2014, 03:05:04 pm
That code snippet should program 0x4141 in page 0, commit the page and read one byte back in.
Doesn't it do that?

B.t.w. I think you'll learn things much faster if you study existing code that does this kind of things.

Personally, I found it helphfull to add println's to ArduinoISP and observe it in action. But to do that, you need an arduino (sanguino, leonardo, mega...) with an extra uart for the printl's because avrdude uses the default one.

Alternatively you could study Nick Gammon's programmer.  It has the serial port free for println's and it does exactly what you are building.

5  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: September 03, 2014, 02:57:17 pm
Maybe it blinks but only weakly? I just observed that he ports p1 through p3 cannot source a lot of current.
So if you wire like this:  "mcu port - led anode - R330 - ground", the led only lights up weakly.
If wire like this "mcu port - led cathode - R330 - 5V" it is more bright. Current is then about 15mA which is on the edge of the spec.

Does the hex file in the avr freaks link I sent above work?

I noticed that after programming the flash, I have to power cycle the chip, but you probably already tried that.
(In mean time I manage to program the chip using (a modified) ArduinoISP)

6  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: September 01, 2014, 02:11:01 am
6MHz should be ok but it is worth tring with another crystal. Mine is 12 MHz. caps are 2x 20 pF.

@erni: What I don't understand either is that usbasp manages to read the signature bits: for the at89s52 thse are not in contiguous places in memory, they are at 0, 0x100 and 0x200. I wonder how usbasp manages to read these 3 bytes, without special ad hoc code,  just with the info coming from avrdude?
7  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: August 31, 2014, 10:38:42 am
Wiring reliable? caps and crystal close enough to ic?
Maybe post a pic of your setup.
8  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: August 30, 2014, 01:13:46 pm
A couple of years ago I wanted to explore the 8051. For this purpose I sampled two types of the more recent at89lp series. I added at89lp support into ArduinoISP so I could use avrdude to program the chips.
I digged up that project and am adding support for the at89s52 which looks not a lot of work. I can keep you posted if you want.
9  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: August 30, 2014, 01:05:06 pm
It is not defined (in the datasheet) what is shifted in while you shift out the first 3 bytes.
But while you shift out the 4th byte, you should see 0x69 being shifted in.
It does not matter what you shift out as 4th byte but is makes sense to shift out 0x00 and check whether you shift in 0x69:

I tried your sketch on a leonardo connected to an at89s52. I see this:
The 4th byte reads 0x69 indeed.

I extended the skech so it also reads in the signature bytes:

#define READ_SIGNATURE_0  0x28000000L
#define READ_SIGNATURE_1   0x28010000L
#define READ_SIGNATURE_2  0x28020000L

sendCmd(READ_SIGNATURE_0, true);
sendCmd(READ_SIGNATURE_1, true);
sendCmd(READ_SIGNATURE_2, true);

This gives me this extra output:

The last bytes from each line are: 0x1E 0x52 0x06, which is indeed the signature of an at89s52.

10  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: August 26, 2014, 02:54:41 pm
Interesting link. Though it is not using ArduinoISP, it uses some sketch dedicated to the programming tool also available on that side.

In my reply above, my expectation that avrdude+ArduinoISP could do the job is wrong: ArduinoISP does not interprete info from avrdude about e.g. what command to issue for a "program enable". All this is hard coded... When I come to think about it, this is a pity: ArduinoISP is used by a lot of people and it could be a lot more usefull if it used more of the info coming from avrdude...
11  Using Arduino / Microcontrollers / Re: Program At89S51 with Arduino SPI library on: August 25, 2014, 04:46:15 pm
I'm asking my self also on how the data is programmed on the chip after sending the "Programming enable instruction" is by using MOSI itself or I have to put something on the address line and data line ?
SPI is a serial interface, everything is sent on MOSI and read from MISO.
"...Serial programming instruction set"  page 20 the byte 2, 3, 4 have "xxxx A11 A10 A9 A8" or "A7 A6 A5 A4 A3 ..." and I'm struggling to understand what they mean by these.

It means you first send the opcode (byte1), then in byte 2 you send the highest bits of the address (highest 4 bits are don't care: xxxx),  byte 3 holds the 8 least significant bits of the address and finally byte 4 is the data you want to write at that address.

My request is there someone can answer me about  what I've asked and tell me if this project is feasible or not ?
It is feasable and a good exercise as you indicate.
But assure yourself you want to do the exercise: incidently I just bought a  programmer (an sp200s clone) for only 12$, that can do the at89s52. It seems to work but it is black box, you don't see what is happening so this does not learn you anything on ISP or SPI of coarse.

If you are still convinced you want to do it from your arduino, this link may be interesting:
It indicates you can program the at89s52 with avrdude + usbasp. I would expect that avrdude + arduinoISP should work too.

12  Development / Other Software Development / Re: Modify USB profile to remove serial port - just want keyboard on: August 25, 2014, 04:06:49 pm
Have a look at the snippets in this message: It is about leaving out the hid device and keeping only serial. You want to do the opposite, but that is a similar task.

If this is for use with windows, you'll also need to create a .inf file that instructs windows to use the generic hid driver when it sees your usb 'product'. It is best to use a product id different from the leonardo's, such that windows can handle correctly both a standard serial+hid leonardo and your customized one. (note you can use arduino's vendor id only for personal use, experimentation).
On linux this is all transparent, it will pick the right driver based on the usb class info your firmware exposes.

Normally the bootloader enumerates a keyboard, mouse, and serial port,

Actually the bootloader exposes serial port only, it is the sketch that is started afterwards that exposes serial + hid.
13  Products / Arduino Yún / Re: Connect yun mini usb with yun USB A does not work. on: January 21, 2014, 04:00:09 pm
You can ignore that message.
It only means the USB device is just a simple serial line, not a modem.
If you connect the Yun to a linux pc, the pc will give the same error message, but you can of coarse perfectly communicate with it.
14  Products / Arduino Yún / Re: Use Yun bridge without a Yun? on: October 17, 2013, 03:20:10 pm
Ok, I did a git pull and ran from there.

Note that the overloaded function SerialBridgeClass::begin(int baud) in the new code is wrong, the baud rate must be an unsigned long for baudrates like 115200 to work. Adding just an optional baud argument like in my code snippet works also and is backward compatible too.

I observed not behavioural differences. On the Leonardo it works a bit faster than on the Duemilanove. As said, I will  try to figure out where the latencies come from. Does this run smoothly on the Yun?

15  Products / Arduino Yún / Re: Use Yun bridge without a Yun? on: October 16, 2013, 03:31:06 pm
I would not be surprised if the developers used a regular arduino and a pc to develop the bridge.

I gave it a try with a Duemilanove (I have no Uno) and a Leonardo.

When compiled for the Leonardo, the bridge library uses Serial1 (the uart), so you have to hook up a serial to usb converter to the tx (1) and rx (0) pins. Communication with the bridge goes via this extra converter. But the upside is that you have Serial free for println debugging.

When compiled for the Duemilanove, the bridge library automatically uses Serial, so communication goes via the (only) usb cable.

As suggested elsewhere in this forum I added the possibility to start the bridge with a specified baudrate. In Bridge.h I made this change:
class SerialBridgeClass : public BridgeClass {
  void begin(unsigned long baud = 250000) {
I feel more comfortable with 115200 as baudrate, so in the ConsoleRead sketch:

Upload e.g. the ConsoleRead sketch to the Duemilanove, Leonardo....

The bridge library does not set the baud rate, so you should do that yourself:
stty -F /dev/ttyUSB0 115200

Get the YunBrigde source from Arduino's git hub repository.

The avr on the Yun fires up the bridge on linino by itself, but for experimentation on the pc you can just start it manually. e.g. for the Duemilanove:
python </dev/ttyUSB0 >/dev/ttyUSB0

The bridge  will try to run the scripst /usr/bin/blink-start and /usr/bin/blink-stop. You might comment this out in, but I just installed two dummy scripts on my pc and made them executable:
echo "$0" 1>&2

In the scripts, make sure not to echo stuff (for debugging) on stdout because it will be sent to the arduino, messing up the bridge communictaion. That is what the 1>&2 is for: it makes sure echo's output ends up on stderr. Likewise if you want to do 'printf debugging' from the python scripts, don't use print, but use:
from sys import stderr
stderr.write("some string\n").

The arduino may kick out the  python script by sending it the 'XXXXX' command. Just start it again or ignore the command in

Now, in another terminal window, say telnet localhost 6571 and you should see 'Hi, what's your name?'

I did not yet manage to make it run smoothly though. If I type my name, it takes several seconds till I see 'Hi peter! Nice to meet you!'
It looks as if for every send from the arduino to the pc, there is a latency of a second or so. I want to figure out where this comes from...I have no Yun, so I don't know whether it runs smoother on a Yun. I see no reason why it would. On the Yun, there is no usb to serial converter involved but that should not be a bottle neck?. Maybe I did not yet find the magic stty settings?.
Pages: [1] 2 3 ... 9