Show Posts
Pages: 1 ... 7 8 [9] 10
121  Forum 2005-2010 (read only) / Interfacing / Re: Beginner question, Bluetooth-mate on: March 26, 2010, 12:27:54 pm
I found the answer here:

http://www.flickr.com/photos/ricardo_ferreira/4225911933/


122  Forum 2005-2010 (read only) / Interfacing / Beginner question, Bluetooth-mate on: March 25, 2010, 10:02:44 am
I need some help to begin playing around with sparkfuns bluetooth-mate and Arduino on OpenSuse Linux.  

Seems the connection between Arduino and BT-mate is ok (?)

hcitool scan
Scanning ...
        00:06:66:03:A9:11       FireFly-A911

I assume the FireFly is the BT-Mate.

The Arduino programm sends every second a string

 Serial.println("ABCDEFG");

I can not find something like  e.g. '/dev/tty.FireFly-A898-SPP-1".

Where to find a BT-Mate HowTo for Linux user ?
How to setup this device ?
How to receive this string with my terminal or processing ?

thanks
wally
123  Forum 2005-2010 (read only) / Interfacing / Re: UART Interrupt problem -solved on: February 12, 2010, 09:21:38 am
This works very nice on 115200 Baud

Code:
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

volatile unsigned char counter = 48;
volatile unsigned char result = 0;

void setup() {
  sbi(UCSR0A, U2X0);
  sbi(UCSR0B, RXCIE0);
  sbi(UCSR0B, RXEN0);
  sbi(UCSR0B, TXEN0);
  UCSR0C = B00000110;
  UBRR0H = B0;
  UBRR0L = B00010000;
}

void loop() {
  delay(300);
  uart_send(counter);
  uart_send(9);        //TAB
  uart_send(result);
  uart_send(10);       // LF
  //uart_send(13);       // CR
}
  
ISR(USART_RX_vect)  {
   counter++;
   result = UDR0;
}


void uart_send(unsigned char dat) {
  while(! (UCSR0A & ( 1 << UDRE0))  );  // until dararegister is NOT empty
  UDR0 = dat;                          
}

unsigned char uart_read() {
  while(!  (UCSR0A & (1 << RXC0)) );  // until Receive complete is NOT complete
  return UDR0;
}

124  Forum 2005-2010 (read only) / Interfacing / UART Interrupt problem on: February 12, 2010, 05:40:38 am
I want to count events when on uart receive
and print out the received data.
What is my mistake in this code ?
I'm working on Linux with Arduino 2009,
ATmega328p, IDE018.

in my /opt/cross/avr/include/avr/iom328p.h

#define USART_RX_vect     _VECTOR(18)  /* USART Rx Complete */

in Atmel documentation for Atmega328p
19 0x0024 USART, RX USART Rx Complete

( 0x18 is 24 decimal)

Code:
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>

unsigned char counter = 0;
unsigned char result = 0;

void setup() {
  Serial.begin(115200);
}

void loop() {
  delay(1000);
  Serial.print(counter, DEC);
  Serial.print(" - ");
  Serial.println(result, DEC);
}

ISR(USART_RX_vect) {

  counter++;
  result = UDR0;
}

/*
SREG     : 10100010
UCSR_A   : 1000010
UCSR_B   : 10011000
UCSR_C   : 110
UBRR_H   : 0
UBRR_L   : 10000

already tried:
ISR(USART_RX_vect)      compile error, multiple defs
ISR(USART0_RX_vect)     don't work
ISR(USART_RXC_vect)     don't work
ISR(USART0_RXC_vect)    don't work
*/  
  
 

125  Forum 2005-2010 (read only) / Interfacing / Re: EEprom lifetime question on: February 09, 2010, 02:19:44 pm
Just in case i'm not the only remaining stupid guy and for reference i send a nice working example which also shows the neighbours of the byte written in area above 255 (here 511)

Code:
#include <avr/eeprom.h>

void setup() {
  Serial.begin(9600);

  const uint8_t *p__ ;
  uint8_t val = 117 ;

  p__ = (const uint8_t *) 0x1FF;  //511

  eeprom_write_byte( (uint8_t*) p__, val );
  eeprom_busy_wait();

  Serial.println(eeprom_read_byte( (uint8_t*) p__  -1), DEC );
  Serial.println(eeprom_read_byte( (uint8_t*) p__    ), DEC );
  Serial.println(eeprom_read_byte( (uint8_t*) p__  +1), DEC );
}

void loop() {
;
}

 
126  Forum 2005-2010 (read only) / Interfacing / Re: EEprom lifetime question on: February 09, 2010, 12:47:53 pm
Code:
So the question is due to insufficient knowledge of pointers.

Seems you are right also in the above quoted point.
Thank you for clearing this. I will go to learn on pointers again now and test the eeprom write function this way.  
127  Forum 2005-2010 (read only) / Interfacing / Re: EEprom lifetime question on: February 09, 2010, 12:29:11 pm
Pauls question is exactly my problem.
But maybe i'm missunderstanding something.
128  Forum 2005-2010 (read only) / Interfacing / Re: EEprom lifetime question on: February 09, 2010, 01:45:18 am
Udo,

Quote
Of course there is an easier way

I can not find the easy way to write a single byte in address space above 255 without affecting neighbour of this address in the avrlib docs.
Might you point out (copy/paste here) which part of the docs you are referring to, please.
Thank You.
129  Forum 2005-2010 (read only) / Interfacing / Re: EEprom lifetime question on: February 07, 2010, 08:51:59 am
Ok, thank you, much clearer now.

By  the way:
Is there an easy way ( without spliiting and recombining an uint16_t) to write an uint8_t in an area above 255 using the avrlibs ?
130  Forum 2005-2010 (read only) / Interfacing / Re: EEprom lifetime question on: February 07, 2010, 06:10:09 am
Thank You Udo,

now remains me to figure out writing a "0" to a
"0" is erase . earase/write or leave it as is.
131  Forum 2005-2010 (read only) / Interfacing / EEprom lifetime question on: February 07, 2010, 04:28:50 am
ATMEL says the cell lifetime of an EEprom cell is about 100 000 write cycle/ cell.
If i do not change the value of a cell, does this stress the lifetime ?
e.g. writing word with values between 0-255,
does this decrease the lifetime of the MSB where always o is written ?
132  Forum 2005-2010 (read only) / Interfacing / Re: ADXL330 Accelerometer Power supply ? on: January 31, 2010, 09:46:24 am
Thank You , found it now on page 4
133  Forum 2005-2010 (read only) / Interfacing / ADXL330 Accelerometer Power supply ? on: January 31, 2010, 03:28:54 am
The datasheet of the ADXL330 says that 3.6V  
is the max power supply for this device.
http://www.sparkfun.com/datasheets/Components/ADXL330_0.pdf

The Arduino Tutorial page
http://www.arduino.cc/en/Tutorial/ADXL3xx
describes a project with an Arduino2009 and it seems to me that the power voltage is 5V here.

Is this good for the health of this device ?
May i destroy it in this way ?

134  Forum 2005-2010 (read only) / Interfacing / Re: Interfacing with an PC Keyboard as Input on: December 29, 2009, 10:42:10 am
Thank You!
This is exactly what i'm looking for and
sorry i did not find myself before posting here.
135  Forum 2005-2010 (read only) / Interfacing / Interfacing with an PC Keyboard as Input on: December 29, 2009, 10:20:18 am
I wonder if it is possible to send keystrokes
from a standard PC keyboard (PS/2) directly
to an Arduino.
Is there a sketch and/or a connection schematic already known ?  

Pages: 1 ... 7 8 [9] 10