Show Posts
Pages: [1] 2
1  Using Arduino / Installation & Troubleshooting / Re: Upload sketch using Bluetooth on: January 13, 2013, 08:36:03 am
Maybe I should have spotted this before since there are so many questions about avrdude getsysnc on the forum....
There is a return value  'resp:0xZZ'  that should give a clue to the problem.
Response i am seeing is:-

avrdude: stk500_getsync(): not in sync: resp=0x6d

Is there info anywhere on what 6D means?

I've looked at some avrdude files on Github but the're beyond me.

Is there more basic info anywhere else?
2  Using Arduino / Installation & Troubleshooting / Re: Upload sketch using Bluetooth on: January 12, 2013, 01:01:31 pm
I've checked the connections.

The RTS was connected to the reset pin, but via 10k resistor. Just tried with that jumpered out, but it doesn't seem to be any different.

The USB FTDI module, usually used to communicate/program the Pro Mini, has a DTR connection which is connected to the reset pin. That resets the arduino before download commences and works fine..
http://www.hobbytronics.co.uk/ftdi-basic

There is no DTR available on the BT module, only RTS. CTS on both modules are linked to GND(0V) by the Arduino.
http://www.hobbytronics.co.uk/wireless/bluetooth/bluetooth-module


I've tried setting the baud rate to 57600, both in the sketch and BT comms.
I've tried selecting the Arduino BT w/ ATmega328 as the destination board.
That sets the 'Overiding Baud Rate' to 19200.
(Shown in verbose output screen).


It looks as if, launching the IDE interupts the BT comms and when selecting Tools menu.
I guess, unless some code is added to specifically account for this, it's not going to work.
That's beyond me....

Thanks for the suggestion.

Here was the verbose output when Arduino Pro Mini 328 was selected.

+++++++++++++++++++++

Binary sketch size: 2,810 bytes (of a 30,720 byte maximum)
C:\ARD\arduino-1.0.3\hardware/tools/avr/bin/avrdude -CC:\ARD\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM10 -b57600 -D -V -Uflash:w:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build8789640708237537257.tmp\BT_test01.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\ARD\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM10
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: m [6d]
avrdude: stk500_getsync(): not in sync: resp=0x6d

avrdude done.  Thank you.

+++++++++++++++++++++

3  Using Arduino / Installation & Troubleshooting / Upload sketch using Bluetooth on: January 09, 2013, 06:26:40 pm
Hi.

I have spent some time with led strips and Arduino Uno. Have now moved on to Arduino pro mini 328 as a smaller physical format.
Trying to get a reliable bluetooth connection.
I am now using IDE 1.0.3

Arduino pro mini 328.
Sparkfun FTDI basic serial interface for wired connection and programming of bluetooth module.

All configured at 115200baud.

Hobbytronics Bluetooth-M interface.
Bluetooth module is EGBT-046S
Paired this device to laptop pc.

BT module supports a serial interface connection/protocol (but not HID).

Setup using FTDI USB wired interface.
Loaded a basic sketch, which just outputs some text/time values to the serial port every few seconds.
It will also print the ascii value of a character typed on the keyboard, over same serial port.

OK.
Swapped the FTDI for the Bluetooth interface.

Can establish connection with the BT module using windows (XP) quick connect facility.
Opening Arduino IDE seems to drop the BT connection. Then, using Tools, Serial Monitor, seems to re-establish it. smiley

The afformentioned output to the screen is seen and again, typing a character on the keyboard prints the ascii code. so the BT link is working. In a 'short' test this has been run for over ten minutes and continues without problem.

However. I can't get a sketch to Upload via BT.
Clicking on the Upload arrow in the IDE, drops the BT connection (if it was on during abve test). The Uploading progress bar in the IDE moves to  almost the end but  then just stops. (Looks as if the compile has finished but the upload is stuck). No error message.

I've tried selecting other boards (eg with Arduino BT w/ ATmega 328) to no avail.

Anyone achieved upload? Is the HID protocol/connection of relevance?

Sketch here.

++++++
int SerialInVal;
void setup()
{
  Serial.begin(115200);
  Serial.println("BT_test01 (115200baud)");// print name of sketch running...
}

void loop()
{
  Serial.print("millis = ");
  Serial.println(millis());


  if (Serial.available())
  {
    SerialInVal = Serial.read();
    Serial.print ("Character = ");
    Serial.println(SerialInVal);

  }//endof if Serial.available()

  delay(2000);
}// endof Void Loop()


++++++




4  Development / Suggestions for the Arduino Project / Re: Bug/Request: Line numbers in the editor! (to correspond with error messages) on: June 11, 2012, 10:02:08 am
Well.
I've noticed that number on a few occasions and didn't twig what it's value was indicating...
That's useful.

If there was a folding facility for brackets, that would also be really useful.
The increase in compile speed in 1.0.1 is welcome.
5  Using Arduino / Programming Questions / Re: small problem with float on: May 28, 2012, 04:11:12 pm
A variation of 0.01 equates to approx half a mile.
So,   +/-  this on two readings could be a mile out! smiley


What target accuracy are you trying to achieve?


6  Using Arduino / LEDs and Multiplexing / Re: Charlieplexing issue on: May 16, 2012, 09:58:43 am
Ok on the multiple leds.
But I was thinking of Charlieplexing more in Arduino terms... as in that library.

But yes. You can turn on more than one led at a time.

But, that makes it difficult to calculate a resistor value for current limiting.
For any fixed resistor value, the led brightness will vary, depending on how many leds are on at a given time (in a common group).

It's probably better (at least would be more consistent/easier)  to stick to 'one at a time'.

Or maybe PWM would help solve the multiple leds on current/brightness issue?  smiley-lol

7  Using Arduino / LEDs and Multiplexing / Re: Charlieplexing issue on: May 16, 2012, 08:25:16 am

I'm no expert on this, but Charlieplexing is a dynamic function.

It is intended to control leds INDIVIDUALLY by pulsing them ON when required.
For two (or more) leds to be ON 'at the same time' - eg. for traffic lights - they are actually being switched ON then OFF individually rapidly. So they 'look' as if they are on at the same time due to persistance of vision.

It looks as if what you are trying to do isn't strictly Charlieplexing....

For software and examples, refer to the library :-

http://arduino.cc/playground/Code/Charlieplex

For 6 leds, you only require 3 outputs.
Your green leds should be connected between 'ledpinA' and ledpinC

For your hardware, make these basic tests on the leds.

Assumiming a 5V supply and limited Arduino output current to 20mA.

Nominal forward voltages.
Red led Vf = 1.8V
Green/yellow led Vf = 2.2V

This equates to 160R and 140R resistors.
So for a test, use a standard value 150R resistor to supply one colour led individually from a 5V supply.
Note the brightness.


Test conclusion.
Are the colours similar (acceptable) in intensity?


No.  -> You're stuffed until you find some that are.

Yes. -> Continue.


Because each output pin is used as a source and sink (5V supply and 0V) during Charliplexing, each output pin needs a resistor in series with it.
Using a 75R resistor in each output gives a 150R (for a nominal 20mA) total resistance.

because at any one time:-
One output will be ON (+5V).
One output will be OFF (0V).
All the others will be in input mode. (High resistance).

Hope this helps.




8  Using Arduino / Project Guidance / Re: Scrolling text question. on: March 30, 2012, 06:49:37 pm

There is code for generating font data in the column x row format, which you'd need to modify to get the row x column format, but that shouldn't be too hard.


I think the normal font data is referred to as a raster font isn't it? Probably the way a TV screen picture was created by a raster dot.

You mention some code for generating the 'other' type is available.
Would you have any link to it - what does it run on?

I've created an excel spreadsheet, based on a hex file for a 5 x 7 font I have. I'm then 'upscaling' - doing it 'by hand' to 5 x 14. (Or should that be 14 x 5)?.

I've done the basic spreadsheet structure. Scaling the column and row widths, to simulate the final layout construction, it does provide a reasonable visual idea of how characters will look. (Bearing in mind, the odd pixel height to width ratio i'm using).

The font should eventually just fit in the 1k of EEPROM on the Uno, using characters 30 to 126 (dec).
IE.  94 characters at 10 bytes / char.

Only done 4chars at the moment smiley-sad  but now concentrating on the code to display it.
Adafruit have done a good job with the LPD8806 library. It seems to work a treat.

9  Using Arduino / Project Guidance / Re: Scrolling text question. on: March 29, 2012, 07:25:11 pm
I was thinking of going with 5 x 12 or maybe 5 x 14 for the font size.
The scrolling text part of the project, is really a 'very nice to have' additional feaure. So I'm not too concerned about a row or two not being used.
Although, as you rightly say, 5 x 7 would be a waste and probably difficult to read, given the strips will be mounted maybe 4 or 5 inches apart.

As long as there are no real negatives, I'll push on with creating the 'sideways' font.

Thanks.
10  Using Arduino / Project Guidance / Scrolling text question. on: March 29, 2012, 06:36:13 pm
(Sorry for the rather long question).

I have a 5m strip (160 leds) of LPD8806 type addressable led, I'm using for testing at the moment. (Some great colours and patterns while learning more Arduino coding and using librarys etc).
I'm considering a srolling text display which is probably going to be 10 columns of 16 leds.

Now for the characters:-
All bitmap arrays I've come across seem to be arranged  column x row.
Typically taking 7 bytes per character. (Unless going for a larger font).

E.G. For a exclamation mark,(!) the following is for a 5 by 7 'font'.

Where X=On   and $ signifies Hex
       displays something like this

$20,  ..X.....   
$20,  ..X.....
$20,  ..X.....
$20,  ..X.....
$20,  ..X.....
$00,  ........
$20,  ..X.....

The 3 LSBits are usually 0 which is used for gaps between characters.

As I understand it:-

To gradually move the characters onto a display matrix, each bit in each of the 7
bytes,starting with the MSbit, has to be checked to see if it is ON, then the next and
so on, as each column is moved onto the display grid (or display buffer first) and then the relevent led turned on.

I've been thinking, if I created a font bitmap row x column, (instead of column x row), it wouldn't be necessary to do the bit checking and I could just index the column data straight into the display (buffer) column.

So the same data for an exclamation mark would be

$00,$00,$FD,$00,$00,$00,$00,


Has anyone any ideas on this or can see any pitfalls?
Or is it maybe common and I've just not come across it?

Thanks.
John.

11  Using Arduino / Programming Questions / Re: Statement required twice for sketch to work on: March 12, 2012, 06:40:55 pm
Ahh!

Yes. I've twigged now.

So the leds probably do display the data briefly, for one scan.
Then because countNow is not preserved the leds subsequently display whats left of it.
0.


Thanks again.
12  Using Arduino / Programming Questions / Statement required twice for sketch to work on: March 12, 2012, 05:44:21 pm
Could someone explain why this statement has to be included twice for this sketch to work please?
The sketch just takes a character input from the USB port -using serial monitor- echos it back to the screen and displays its value on the leds -in decimal or hex.

Duplicate code highlighted in the code window like this....

//+++++++++++++++++++++++++++++++++++++++
 countNow = SerialInVal; //                           +
//+++++++++++++++++++++++++++++++++++++++

Exactly the same statement is made in the code about 5 lines above it.

But without this extra one, the leds always display  0.
I am aware that countNow is destroyed by the subsequent code. I have taken this from another sketch i was using.

Code:
/* JR 15/1/2012
  Take a character from USB port and write its value to  HP5082-7340  LED displays.
*/

//++++ found defining these where they are used in the program saves memory
//byte state;     // flag
//byte selectHex; // 0 display in decimal , 1 display in hex
//long lsn;       // least ignificant nibble  - lttle endian
int outPin;

int outPins[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };   
// array of pin numbers to which LEDs are attached
// pins 2,3,4,5 are display data bits 0,1,2,3
// pin  6 (Pwm)is blanking  (1 = blank)
// pin  7 is display latch  (1 = latch)


long countNow;
int SerialInVal;



void setup()
{
  // loop over the pin array and set them all to output:
  for (int pin = 0; pin < 10; pin++)
  {
    pinMode(outPins[pin], OUTPUT);
  }

  analogWrite(6,100);     // lower value = brighter display -
                          // (these displays consume a lot of current)
  pinMode(A5,INPUT);      // Pushbutton on A5 input -
  digitalWrite(A5,HIGH);  // used for selecting Decimal or Hex display

  Serial.begin(9600);

}// end of void setup


void loop()
{
  byte selectHex = !digitalRead(A5);// read state of pushbutton and invert it

  if (Serial.available())
  {

    SerialInVal = Serial.read();

    Serial.print(SerialInVal);
    Serial.print("\t");              // prints a tab
    countNow = SerialInVal;
    Serial.print(char(countNow));
    Serial.print("\t");              // prints a tab
    Serial.print(char(countNow-1));
    Serial.println("");


  }//end of if serial available


//+++++++++++++++++++++++++++++++++++++++++++++++++++++
 countNow = SerialInVal; //                           +
//+++++++++++++++++++++++++++++++++++++++++++++++++++++ 
 

  long lsn = countNow;   
  long count = countNow;

  for (int pin = 7;pin < 12; pin++)
  {
    if (selectHex == 0)
    {  //++++++++++++++++++++++++++ convert 'lsn' to bcd for decimal display
      long temp = countNow / 10;
      lsn = countNow - (temp * 10);
      countNow = temp;
    }
    //+++++++++++++++++++++++++++ otherwise, just output 'lsn' in hex

    // output data to display 
    for (int bitValue = 0; bitValue < 4;bitValue++)
    {
      outPin = bitValue + 2; //pin is bit position + 2
      byte state = lsn & 1;
      digitalWrite( outPin,state);
      lsn = lsn >> 1;
    }

    // write to the relevent display
    digitalWrite (pin, LOW);  //enable display to read data
    digitalWrite (pin, HIGH); //latch data   

  }



}//end of void loop

13  Using Arduino / Programming Questions / Re: BCD conversion on: January 15, 2012, 05:41:39 am
Thanks for the info.
The 'data' to be displayed presently, is just a counter.
The solutions are somewhat more simple than i'd anticipated.

Which is great news!

I've found the displays are actually HP5082 -7340
- which means, I can display the number in Decimal or Hex smiley
Of course in Hex, I won't need to use the conversion.
14  Using Arduino / Programming Questions / BCD conversion on: January 14, 2012, 07:02:16 pm
Looking to convert a 'long to bcd' to drive 5 led displays.
(HP5082 -7302)

Is there a function in a library somewhere to do this, or will it have to be done from scratch.

I know things have moved on since these were about, but would just like to use them....

TIA.
15  Using Arduino / Programming Questions / Re: IDE1 and wiring.h on: January 13, 2012, 03:40:51 am
Thanks.
I'll have a closer look at those libraries.
I assume Arduino.h is one of them?

Sorry for hi-jacking the thread smiley
Pages: [1] 2