Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Microcontrollers / Re: Creating pin definitions & boards.txt entries on: November 04, 2012, 04:44:38 pm
I don't think the signature is package-dependant. I can't say for sure with the '1284p but with the 328's I've used, it didn't matter if they were DIP or SMD.
2  Using Arduino / Microcontrollers / Re: Creating pin definitions & boards.txt entries on: November 04, 2012, 08:25:15 am
My understanding is that the package doesn't matter, so you should not need another pin definition file or boards.txt entry.

Eg. the UNO does not have two entries for the DIP versus SMD versions.
3  Using Arduino / Sensors / Re: HMC6352 digital compass - memory / register map? on: October 26, 2012, 02:37:04 pm
Thanks for the info! Your library looks much more thorough than others I've seen and tried.

For your implementation of the RAM read and write functions you have the comment // Most RAM locations have an unknown meaning. Did you actually try dumping all the RAM yourself?

Cheers!
4  Using Arduino / Sensors / HMC6352 digital compass - memory / register map? on: October 26, 2012, 09:09:37 am
I'm working with this Honeywell HMC6352 digital compass and I've been trying to find if they list a memory map or register map anywhere but have been coming up with nothing.

The datasheet does list the EEPROM map, and it provides functions for reading (and writing) to RAM, but it does not give a list of RAM addresses. Two addresses are mentioned in the text but nothing beyond those two.

If there's no published information on the memory map, would there be a way to go about poking around and figuring it out?

Would it be safe to just issue read commands to addresses to see what comes back? Eg. read every byte from address 0x00 to 0xff and see what comes back?

I'm looking to learn all the ins and outs of this part but it's about $30 so I don't want to kill it in the process.

Thanks!
5  Using Arduino / Microcontrollers / Re: ATmega1284P: End to End using 1.0 IDE on: October 17, 2012, 08:17:53 pm
Touch wood, I haven't run into any trouble yet with the '1284p. I'm using Sparkfun's Pocket Programmer (USBTinyISP compatible) to burn bootloaders.

Also, I've only used the TQFP version.
6  Development / Other Hardware Development / Re: Found a place for cheap pcb manufacturing on: October 17, 2012, 12:50:40 pm
One debugging step I have learned the hard way is to view only layer 19 the unrouted layer.  In a complex board you may not be able to see short unrouted air traces, by only showing the unrouted layer you of course can see them clearly if they are there.

Unrouted traces can occur if you route by hand or auto so I think this is a good debugging step.

wade

I so wish there were a way to include a test for airwires in the DFU rules. I accidentally sent a board off with an unrouted trace... d'oh! Though in the end it was an excuse to add a bit more functionality to the project with another revision, it was still an aggravating mistake.
7  Using Arduino / Microcontrollers / Re: ATmega1284P: End to End using 1.0 IDE on: October 14, 2012, 08:28:21 am
@Steph:
thanks for your reply.
The Ax enumeration isn't a problem, in the past I've already encountered this issue.
Can I ask you more about:
1) pin_arduino.h file: which variant did you use? I used the one from Maniaccbug's core;
2) when you recompiled the bootloader, did you only modify the make file to create the new entry for 1284p or did you modify the bootloader code too?

I created my own pins definition. Initially I was working with the Sanguino one but I could never remember which port/pin was which arduino pin so I re-did it with a pin mapping that I could remember.

For the bootloader, I initially managed with just a change to the make file - my project is running at 8MHz with a resonator - but I found the 19200 baud upload to be too slow. To get it working reliably at 57600 baud I had to modify the source file to enable the UART speed doubling function. (My next revision is going back to a crystal and hopefully that will be stable enough for 115200 baud so I will modify the bootloader again to test it.)

Finally, I put everything including my own 'boards.txt' file into my arduino data folder under /hardware. So it's using the custom pins file and bootloader but pointing back to the core files for the actual sketches.

I can zip it all up and post it if you like? When my project is finally completed I'll be posting everything to GitHub but I'm waiting on the next PCB revision and don't want to put it all out there till I know the hardware and software are all working correctly.

Cheers!
8  Using Arduino / Microcontrollers / Re: ATmega1284P: End to End using 1.0 IDE on: October 13, 2012, 04:13:45 pm
I am using the Arduino 1.0.1 core with a 1284p and it works quite successfully. I did define my own variant for the pins_arduino.h header, and I'm using a variation of the Sanguino bootloader (recompiled for 1284p, 8MHz clock, 57600 baud) but the bootloader is the only compiled non-core thing I'm using.

Both UARTs work fine for me, as does SPI and I2C. I haven't checked all the built-in libraries but I believe the ethernet library might have an issue as it has some pin selections 'hardcoded' based on AVR / board (eg. uno / mega or 328 / 2560) but of course there's no entry for the 1284p.

The only other caveat is how the analog pins are assigned if you use the "A0, A1, ... A7" syntax. There's some lines in wiring_analog that translate things differently so it was easier to not use the A0 A1 etc. names.

Cheers!
9  Using Arduino / Project Guidance / Re: ADC to 8Bit Pins on: October 01, 2012, 11:56:46 am
I suppose we do need to know more info from the OP to understand what he's actually aiming for.

I was thinking something along these lines would toggle 8 pins according to the value of an analog read:
Code:
int value=analogRead(0); // read the port
value = value >> 2; // go from 10 bits to 8 bits
PORTD = lowByte(value); // set digital pins 0 to 7 accordingly

Of course that makes a great deal of assumptions as to what is actually required.
10  Using Arduino / Programming Questions / Re: Leonardo CDC handshake signals on: October 01, 2012, 11:47:40 am
You might want to look into Teensy (or Teensyduino) for this. Some of the serial control signals are implemented in their version of the USB CDC driver, and Teensy uses the same ATMega32u4 chip as the Leonardo.
11  Using Arduino / Project Guidance / Re: ADC to 8Bit Pins on: October 01, 2012, 07:14:29 am
Wouldn't the easiest thing be to just bitshift the result two bits to the right?
12  Using Arduino / Project Guidance / Re: Using Leonardo as mouse. How to prevent automatic driver install on Windows? on: September 27, 2012, 08:50:43 pm
The USB stuff in the Leonardo identifies itself as both a serial and a HID device. So even if you install without the bootloader and you are not using Serial.anything in your sketch, the IDE is still loading the CDC serial stuff into the compiled sketch behind the scenes.

Hopefully in a future version of the IDE it will be more dynamic as it really shouldn't load the CDC stuff if you aren't using it, nor should it load the HID stuff if you never use the mouse.stuff or keyboard.stuff.

In the meantime there are some things you can do to make it not include the CDC stuff, but that involves making some tweaks directly to the Arduino core files. If you find the USBDesc.h file, line 19 is #define CDC_ENABLED, just comment that line out so it is //#define CDC_ENABLED then recompile and load your sketch. Do this without the bootloader again, with your ISP device.

After that, the Leonardo should identify itself as a HUD only and not ask for drivers.

Caveat: With the CDC disabled, it will not Auto-reset any more for loading sketches BUT this does not matter if you haven't got a bootloader anyways.

Cheers!
13  Using Arduino / Programming Questions / Re: Leonardo CDC handshake signals on: September 27, 2012, 08:32:27 pm
I think you'd have to look through the CDC files in the Arduino core, to see if there's a way to emuluate RTS and CTS or control their virtual functionality.

Chapter 18 in the datasheet is all about the hardware serial port, and AFIK should not come into play at all with the USB side of things.

Cheers!
14  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO 300 Baud on: September 27, 2012, 08:17:51 pm
The Arduino (actually the ATMega chip) sets the baud rate using a combination of clock speed and clock divider settings. There are some baud rates where it just can't hit the right bps with enough accuracy, i.e. instead of 300 baud it might be going at 310 or 312 or something like that. There is a margin of error that devices on either end can cope with, but the slower baud rates might be too far outside that margin to be workable.

The datasheet for the ATMega328 gives examples for baud rates (with the % of error)  but it only goes down to 2400 baud in its examples.

There's also something about interrupts, the serial module uses interrupts to handle things behind-the-scenes (this is why you can't use Serial inside an interupt handler) and at the low baud rates the uC can spend so much time in interrupts that the rest of the sketch gets starved out for cycles.

Cheers!
15  Using Arduino / Installation & Troubleshooting / Re: Arduino Leonardo - bug? on: September 26, 2012, 06:58:11 am
You're doing a lot of direct addressing of the AVR ports. Have you checked the Leonardo schematic or the ATMega32U4 datasheet to verify that the AVR ports you are addressing match up to the pins on the leonardo? The 32u4 is very different from the ATMega328 on the UNO, so any sketch that is directly manipulating the AVR ports would need to be rewritten when moving from one uC to the other.

As for the sketch size swelling when you switch from UNO to Leonardo, most of that is due to the USB CDC and HID libraries which are automatically included on the Leonardo board. It's around 2 to 3k difference.

Finally, some of the differences in Serial.xxxx will probably boil down to being due to the Leonardo's serial port being a virtual CDC port so it's using different code than the hardware serial port on the UNO.

But going back to the problems in your sketch, I think it's mainly because the direct port manipulation seems to be configured for the UNO. Eg. the LED is arduino pin 13 on both boards, but it's not the same port/pin from an AVR point of view: On the Uno it's B5, on the Leonardo, it's C6. Almost everything else is different too - the ADC is very different, with the first 6 analog ports on portF then the rest scattered around the other ports.
Pages: [1] 2 3 ... 6