Show Posts
Pages: 1 ... 26 27 [28] 29 30 ... 38
406  Using Arduino / Microcontrollers / Re: Help in programming the Atmega1284 with maniacbug-mighty-1284p. on: January 15, 2013, 09:12:43 pm
I get the same issue with teh 1284P using Mighty1284 Optiboot (Bobuino pinmap).

I can upload Blink but not larger sketches. I eventually gave up and just program via ISP. It's a bit of a pain for serial monitor as I have to keep switching my USB>TTL adapter to monitor, but I'm just going to order another cheap one to use with MTTTY for monitoring.

I have seen mention that trying a swap of the crystal resonator, or switching to a ceramic resonator can cure it, but I've not tried that as yet.

If anyone does know a link to a definitive fix then it would be useful to knoe.
407  Using Arduino / Displays / Re: ST7735R LCD shield w/ SDcage - not working on Mega 2560? on: January 15, 2013, 09:08:28 pm
There IS a difference in speed betwene SPI and normal pins.

What I am saying is that if you connect to 11,12,13 on the Mega2560 then they ARE normal pins.

On the Uno, 11,12,13 are the hardware SPI pins
On the Mega2560, 11,12,13 are NOT the hardware SPI pins

Therefore, when you connect to 11,12,13 on Mega2560 the speed won't be any different than if you use, say, 3,4,5 on the Mega2560.

Using 11,12,13 on the Uno will be a lot faster than using 3,4,5 on the Uno.

To get the hardware SPI speed on the Mega2560, you need to connect to it's hardware SPI pins (50,51,52) OR through the relevant MOSI, MISO, SCK pins on the ICSP header (4,1,3 respectively)
408  Using Arduino / Microcontrollers / Re: ATMEGA64RZAV-10PU on: January 15, 2013, 06:25:31 pm
The model number refers to a bundle; it includes the ATMega644 MCU and an AT86RF230 RF chip.

I'm guessing you've only been given the MCU itself.

The RF isn't embedded in the MCU. If you just have the 40 pin DIP then you only have a normal 644 MCU, but the 10Mhz, rather than 20Mhz version.
409  Using Arduino / Displays / Re: ST7735R LCD shield w/ SDcage - not working on Mega 2560? on: January 15, 2013, 06:15:07 pm
SPI isn't on 11,12,13 on Mega2560

They are just normal pins, that's why there is no difference in speed.

The SPI on Mega2560 is on 50,51,52 and the ICSP header. 53 is hardware SS.
410  Using Arduino / General Electronics / Re: DIY PCB transfer media on: January 15, 2013, 12:04:29 pm
Indexing was my thought for 2 layer boards.

1) Set up your stand-off holes in each corner of your PCB design.
2) Do everything to get the top layer toner transferred onto the PCB or just stick the top sheet in place (heat resistant clear tape?).
3) Drill pilot holes through the board at te centre of each stand-off. Size to be for a 0.1" male header.
4) Print off the bottom layer.
5) Place bottom layer print onto a block of wood and drill the same 4 pilot holes though the paper/vinyl/laminate.
6) Place 4 off 1x1 headers through the PCB from top layer and turn the board upside down.
7) Place your bottom layer print over the 4 keys to line up perfectly via the centres of the stand-offs.
smiley-cool Stick the bottom layer in place (heat resistant clear tape?).
9) Heat transfer the toner onto the copper via heat press, iron or laminator.
10) Remove both sheets of paper/vinyl/laminate and the 4 off 1x1 headers used as keys.
11) Etch
12) Hopefully a perfectly aligned two layers.

I've not tried it yet but I think it should work?
411  Using Arduino / Project Guidance / Re: Can't upload a sketch from the IDE to my bare-bone Arduino Nano on: January 15, 2013, 03:43:47 am
Which boooader did you burn to the MCU and via what method?

The bootloader has a baud rate it expects communication on, and this is complemented by the same rate set in boards.txt so the IDE knows what baud rate to use when invoking avrdude.

If you use Arduino as ISP to burn the bootloader then you normally do it with a target board selected and  hence the correct bootloader and boards.txt entry are in sync.

If you used a different method to burn a bootloader file directly then maybe the bootloader and boards.txt entry don't reflect each other?
412  Using Arduino / Displays / Re: Connecting a mega to a winstar RGB LCD ( WH1602B-CFH-JT - HD44780 ) on: January 14, 2013, 10:59:07 pm
That looks interesting as I thought the only RGB displays were those Adafruit ones where they state they had then made specially.

Usually the last two pins are A and K for the backlight Anode and Cathode. In this case you have A R G B, Anode, Red Cathode, Green Cathode, Blue Cathode.

I might go and see if I can get a couple of those shipped to the UK. :-)
413  Using Arduino / General Electronics / Re: DIY PCB transfer media on: January 14, 2013, 10:53:00 pm
Yeah, I'm not seeing the rationale for the 2nd printing either.

I'm thinking that it's so you can just use a small section of vinyl the right size for what you want. With sticking it to the paper then you can put it back through the printer.

The alternative would be to put a full vinyl sheet tthrough the printer and then cut out a small section afterwards.

I'm guessing as much as you, but that's the only thing that seems logical to me at the moment.
414  Using Arduino / General Electronics / Re: DIY PCB transfer media on: January 14, 2013, 10:38:13 pm
A step by step GUIs would be good, but as I understand it, is this the sequence?

you print onto normal paper just so you can see what you need to cover with a vinyl 'patch'.

Then cut a piece of vinyl just big enough to cover the area to print, leaving the rest of the paper uncovered.

Then run it through the printer again to print the PCB onto the glossy side of the vinyl.

I guess you then transfer from the vinyl to copler by using an iron, heat press or laminator?
415  Using Arduino / Displays / Re: Has anyone got these cheap LCD's to work with arduino? (ST7735R) on: January 14, 2013, 12:16:58 pm
It should work with other SPI Devices, as the SD card example shows.

As long as each device is assigned to it's own CS pin and the correct confit declared in the constructor or library.

As said above though, there can be issues with Wiznet 5100 based board as there is a bug with it where it doesn't release the SPI bus after use. Some shields have a fix implemented to ensure the CS is switched correctly.

I had an Ethernet shield clone that seemed to work OK alongside an nRF24L01+ transceiver on the same SPI bus, so your mileage an vary.
416  Using Arduino / Displays / Re: LCD2004 Help on: January 14, 2013, 08:01:51 am
The new liquidcrystal library will work with just about any character based LCD.

From what I can find on the wiring it looks like the Sainsmart uses a seperate pin for backlight, rather than controls via the I2C bus.

Therefore you may need to wire this to an Arduino pin and declare it, i.e connect to pin 9 and declare as such.

You may also need to use a constructor that sets the connection bit order:

Code:
#define BACKLIGHT_PIN 9
LiquidCrystal_I2C lcd(lcdAdrr,2,1,0,4,5,6,7); // Addr, EN, RW, RS, D4, D5, D6, D7
417  Using Arduino / Displays / Re: LCD2004 Help on: January 14, 2013, 03:49:58 am
First off, I'd recommend you download and install the New Liquid Crystal Library, to replace the default one that comes with your IDE installation.

https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads

Make sure you remove the existing standard LiquidCrystal and LiquidCrystal_I2C libraries. Don't just rename them, you have to remove them from the 'libraries' folder completely or there will be a conflict.

The Sainsmart example code seems to suggest that their I2C backpack is wired in the 'standard' way for the I2C library, but there is an obvious mistake in the page telling you that the interface is on 0x3F, but the example code is for 0x27.

Try the code below, but if it doesn't work with the 0x3F address then try running the I2C Scanner sketch from the Arduino Playground, and it will report the addresses it finds. The replace 0x3F against lcdAddrin the example below with the address you find.

Connect as follows

Code:
LCD Backpack > Arduino
Vcc          > +5V, via a 100 Ohm resistor
Gnd          > Gnd
SCL          > Pin A5
SCK          > Pin A4

The resistor is there to protect the LED backlight. I would guess the LCD module has a resistor anyway, so if the display backlight is dim then you can probably remove this resistor afterwwards and wire Vcc directly to +5V

Once you've done all the above then use the sketch below and compile + upload. Report back whether this has you up and running.

Code:
include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define lcdAddr 0x3F // set the address of the I2C device the LCD is connected to

// create an lcd instance
LiquidCrystal_I2C lcd(lcdAdrr); // I2C addr

// Creat a set of new characters
const uint8_t charBitmap[][8] = {
   { 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },
   { 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },
   { 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },
   { 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },
   { 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },
   { 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },
   { 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },
   { 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }
  
};

void setup()
{
   int charBitmapSize = (sizeof(charBitmap ) / sizeof (charBitmap[0]));

  lcd.begin(20,4);  // initialize the lcd as 20x4 (16,2 for 16x2)
  
  lcd.setBacklight(1); // switch on the backlight

  for ( int i = 0; i < charBitmapSize; i++ )
   {
      lcd.createChar ( i, (uint8_t *)charBitmap[i] );
   }

  lcd.home ();  // go home to character 0 on line 0 (1st line)
  lcd.print("Hello, ARDUINO ");  
  lcd.setCursor(0,1);  // character 0 on line 1 (2nd line)
  lcd.print (" FORUM - fm   ");
  lcd.setCursor(0,2); // character 0 on line 2 (3rd line)
  lcd.print("This is line 3");
  lcd.setCursor(0,3); // character 0 on line 3 (4th line)
  lcd.print("This is line 3");
  delay(1000);
}

void loop()
{
   lcd.clear();
   lcd.home ();
   // Do a little animation by writing to the same location
   for ( int i = 0; i < 2; i++ )
   {
      for ( int j = 0; j < 16; j++ )
      {
         lcd.print (char(random(7)));
      }
      lcd.setCursor ( 0, 1 );
   }
   delay (200);
}
418  Using Arduino / Audio / Re: New library for PWM playback from SD cards: SimpleSDAudio on: January 13, 2013, 07:45:13 pm
Since I've decided to use the 1284P and 644P for the benefit of the extra RAM, FLASH and EEPROM, I've been testing various things to see if everything will work. Obviously the 1284P isn't an official Arduino MCU so it requires some customisation to set everything up.

One thing I was worried about was SimpleSDAudio due to the use of the specific PWM pins and Timers. This turned out to be well founded and so I spent this evening investigating and trying to work a solution.

The other issue is that there are a few variants of pin mapping in use. I'm using the Bobuino variant that puts SPI across pins 10,11,12,13 and RX0/TX0 on D0/D1, to keep some consistency with Uno. There is also a 'standard' mapping that is the same as the Sanguino for the 644P

I managed to get it working in 1.01 and then moved to 1.02 and tried the same fix. So...

I have edited SimpleSDAudioDefs.h and added a new MCU entry for the 1284P and 1284, with both Bobuino and standard pin mappings. I also edited the 644P/644 entry to provide Bobuino pin mapping option, as I will use this with any 644 I use.

I also noticed that only the 168/328 entry has been updated to the Stereo 16 bit usage at the moment. Although I added the additional pins for PWM3 and PWM4. I've left them commented out as my knowledge doesn't extend to confirming if the register entries below it are correct for the 1284.

On the 1284 the OC0A and OC0B are on PB3 and PB4, rather than PD6 and PD5, as per the 168/328. The PWM1 and PWM2 are the same as 168/328 and certainly my 1284 works fine in 8 bit fullrate mono and 8 bit fullrate stereo now. The PWM4 conflicts with SPI SS again, as per the 328.

I wonder if it would be possible to incorporate this into the library direct to save it having to be applied by hand on updates? Maybe you could check if the 'QUAD' options are correct or need some amendement before possibly enabling.

I added the 1284 entry above the 644/Sanguino entry. Remove any comments by me as you see fit. They are just there to highlight what I've actually altered.

Code:
// ADDDED FOR ATMEGA1284P and 1284 COMPATIBILITY - M BEEBY
#elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__)
// Mighty1284P & Bobuino

    // Standard pinmap, same as Sanguino
    //#define SSDA_PWM1_PIN 13 // OC1A
    //#define SSDA_PWM2_PIN 12 // OC1B
    //#define SSDA_PWM3_PIN 3 // OC0A PB3 - NOTE 328 IS DIFFERENT, ON PD6
    //#define SSDA_PWM4_PIN 4 // OC0B PB4 (collision with SPI SS!) - NOTE 328 IS DIFFERENT, ON PD5

    // Bobuino pinmap
    #define SSDA_PWM1_PIN 8 // OC1A
    #define SSDA_PWM2_PIN 30 // OC1B
    //#define SSDA_PWM3_PIN 7 // OC0A PB3 - NOTE 328 IS DIFFERENT, ON PD6
    //#define SSDA_PWM4_PIN 10 // OC0B PB4 (collision with SPI SS!) - NOTE 328 IS DIFFERENT, ON PD5

   
    // Output-compare settings
    #define SSDA_OC1L    OCR1AL
    #define SSDA_OC2L    OCR1BL
//#define SSDA_OC3L    OCR0A
    //#define SSDA_OC4L    OCR0B
    #define SSDA_OC1H    OCR1AH
    #define SSDA_OC2H    OCR1BH
   
    // Register to backup and restore
    #define SSDA_OC_CR1_REG             TCCR1A
    #define SSDA_OC_CR2_REG             TCCR1B
//#define SSDA_OC_CR3_REG             TCCR0A
    //#define SSDA_OC_CR4_REG             TCCR0B
   
    // Always: Prescaler = 1, Fast-PWM-Mode with 8-Bit
    #define SSDA_SINGLE_OC_ENABLE()     { TCCR1A = _BV(WGM10) | _BV(COM1A1); TCCR1B = _BV(WGM12) | _BV(CS10);}
    #define SSDA_DUAL_OC_ENABLE()       { TCCR1A = _BV(WGM10) | _BV(COM1A1) | _BV(COM1B1); TCCR1B = _BV(WGM12) | _BV(CS10);}
    #define SSDA_DUAL_OC_BRIDGING()     { TCCR1A |= _BV(COM1B0); }
//#define SSDA_QUAD_OC_ENABLE()       { TCCR0A = _BV(WGM00) | _BV(WGM01) | _BV(COM0A1) | _BV(COM0B1); TCCR0B = _BV(WGM02) | _BV(CS00);}
    //#define SSDA_QUAD_SYNC() { TCNT1 = 0; TCNT0 = 0; }
    #define SSDA_OC_INT_DISABLE()       { TIMSK1 &= ~_BV(TOIE1); TIFR1 |= _BV(TOV1); }
    #define SSDA_OC_INT_ENABLE()        { TIMSK1 |=  _BV(TOIE1); TIFR1 |= _BV(TOV1); }

    #define SSDA_OC_INTERRUPT           TIMER1_OVF_vect

//------------------------------------------------------------------------------
#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
// Sanguino

//Original standard pin mapping
    #define SSDA_PWM1_PIN 13 // OC1A
    #define SSDA_PWM2_PIN 12 // OC1B

// Bobuino pinmap - Added by M BEEBY
//#define SSDA_PWM1_PIN 8 // OC1A
    //#define SSDA_PWM2_PIN 30 // OC1B
   
    // Output-compare settings
    #define SSDA_OC1L    OCR1AL
    #define SSDA_OC2L    OCR1BL
    #define SSDA_OC1H    OCR1AH
    #define SSDA_OC2H    OCR1BH
   
    // Register to backup and restore
    #define SSDA_OC_CR1_REG             TCCR1A
    #define SSDA_OC_CR2_REG             TCCR1B
   
    // Always: Prescaler = 1, Fast-PWM-Mode with 8-Bit
    #define SSDA_SINGLE_OC_ENABLE()     { TCCR1A = _BV(WGM10) | _BV(COM1A1); TCCR1B = _BV(WGM12) | _BV(CS10);}
    #define SSDA_DUAL_OC_ENABLE()       { TCCR1A = _BV(WGM10) | _BV(COM1A1) | _BV(COM1B1); TCCR1B = _BV(WGM12) | _BV(CS10);}
    #define SSDA_DUAL_OC_BRIDGING()     { TCCR1A |= _BV(COM1B0); }

    #define SSDA_OC_INT_DISABLE()       { TIMSK1 &= ~_BV(TOIE1); TIFR1 |= _BV(TOV1); }
    #define SSDA_OC_INT_ENABLE()        { TIMSK1 |=  _BV(TOIE1); TIFR1 |= _BV(TOV1); }

    #define SSDA_OC_INTERRUPT           TIMER1_OVF_vect

//------------------------------------------------------------------------------
419  Using Arduino / Programming Questions / Re: Phone keypad a bit special on: January 13, 2013, 03:11:07 pm
Thank you for your answers. Unfortunately I can programmed only during the weekend, so I'll keep this post neighbor. See you soon!

Isn't it still the weekend? ;-)
420  Using Arduino / Project Guidance / Re: How to connect Arduino Uno to 25 rgb leds? on: January 13, 2013, 03:08:07 pm
Quote
Alternatively you can use ShiftPWM with constant current LED drivers, which means you don't need a resistor one every led output.
No you need a constant current drive at each LED output. If you think resistors are expensive at $0.01 to $0.001 I am not sure where you will find a constant current drive cheaper.
I don't believe I made any reference or implication that it would be a cheaper way of doing it did I? Not sure why you felt the need to pick that up and imply that I was trying to say something that I wasn't.

No-one uses constant current drivers because it's cheaper than using an alternative, like SR, with resistors. It's done because it's more convenient than soldering bucket loads of resistors, and it's a more consistent way to drive them.

Pages: 1 ... 26 27 [28] 29 30 ... 38