Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: ChipKit (UNO32) shield compatibility matrix on: June 16, 2011, 02:11:46 pm
RuggedCircuits

I am the "whoever" in your post.

The SPI library was finished a day or 2 ago. It may still need some work, let me know.

I have fixed the "PROGMEM", just add this at the start of your program

   #define PROGMEM

I downloaded your Beat707 program. It has a lot of AVR specific code in it. Anything that bypasses the Arduino abstraction layer will have to be re-written.

I really like your compatibility chart. May I have permission to convert it to an html table and use it in our docs.

Let me know other things you find and I will get to them as soon as I can

Mark



Hi

The chipkit board does look pretty powerful. I just got mine. I am having issues with the SPI library. is there any good/better source of documentation on the jumpers and what not to be able to use the SPI. I have set J5 and J7 to master mode. and J4 to Digital I/O mode. when the code is running i tried scoping the SPI pins and I see nothing.

Thanks
Swalehm
2  Forum 2005-2010 (read only) / Syntax & Programs / Re: I2C temperatur Sesnor on: April 04, 2009, 11:04:46 pm
hey skumlerud.. thanx for your reply unfotunately i did not read it after i got the previous reply which had a link and it worked perfectly

i had an addressing error in my code... i forgot to account the fact that the least significant bit is compensated by the wiring library..

thanx again
3  Forum 2005-2010 (read only) / Syntax & Programs / I2C temperatur Sesnor on: March 25, 2009, 08:32:06 am
hi..

I am trying to interface an I2C temperature sensor to the arduino. i followed the examples for the wire librarary but it doesn't seem to work. when i observe it on the scope i can see some signals flashing on the clock line and SDA. but when i display the returned value it is the same as what i initialized it with...

its a DS1624

Thankyou

does anyone know of anything i might have overlooked. here is my code:


#include <Wire.h>
int temp1=0x11ab;
int temp2=0x7Fcd;
void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
  
  Wire.beginTransmission(0x90);
  Wire.send(0xAC);     //  access config reg. command
  Wire.send(0x4A);    //  byte to be sent to config.reg
  delay(500);
  Wire.send(0xEE);    //  start conversion command
  delay(100);
  Wire.send(0xAA);    //  read conversion command

  Wire.endTransmission();
}
void loop()
{
  
  Serial.print(temp1,HEX);  
  Serial.print("-");
  Serial.print(temp2,HEX);  
  Serial.print(" ");
  
  
  

  Wire.beginTransmission(0x90);
   Wire.send(0xAA);    //  read conversion command
   delay(100);
  Wire.endTransmission();
  
  Wire.beginTransmission(0x90);
 
    Wire.requestFrom(0x90, 2);
  delay(100);
    if(Wire.available())
    {
      temp1 = Wire.receive();
    }
   delay(100);
    if (Wire.available())
    {
      temp2 = Wire.receive();
    }
 // Wire.endTransmission();

  Serial.print(temp1,HEX);  
  Serial.print("-");
  Serial.print(temp2,HEX);  
  Serial.print(" ");
  
  delay(25);
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts... on: March 11, 2009, 10:22:49 pm
wow.. that is quite a project with processing.. i did not use any arduino libraries when i created my GUI in processing.. i just set up processing to receive a serial byte and i had my control bits in that byte. therefore my freeduino was constantly sending out the control byte and processing was just receiving it and determining what it was and doing stuff accordingly so i had 2 push buttons on connected to the board. and i had a byte that varied from 1-4 depending on the combination of buttons pressed.. since i was just exploring and did not have any real project with it, i just had it change the color of a box on the screen.

if at all i decide to do my school project on the arduino instead of the Motorola 68HC11 then i also intend to have some sort of GUI for the speed ..etc but i might really need to dig into the arduino library for processing.. you might have noticed that i sometimes use arduino and sometimes freeduino...lol.. freeduino is the board i am using..
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts... on: March 11, 2009, 08:56:42 am
well.. actually i might really not need input capture someone else is making a PWM temp sensor project. i might use my board  instead of the HC11 for a motor speed control project. the instructor gave us a choice to use the HC11 or the freeduino. coz he is just amazed by the freeduino. have you looked into combining the arduino and Processing ?? i tried and i gota say its pretty gud..
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts... on: March 10, 2009, 10:57:29 pm
Thanx alot man..!!

u r awesome.. it worked after i cleared TCCR1A which is kind of strange.. bt it works...

if there's anything you think i can assist you with please do let me know..

Thanks again..


7  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts... on: March 10, 2009, 12:16:32 pm
Good Day..!! this is my latest code.. the results that i get in the serial monitor do vary from 0 - 255 following the code is a sample result pattern.

my input for now is just a push button.

thank you

boolean state = HIGH;
int ledPin = 13;                 // LED connected to digital pin 13

unsigned volatile int viCountnew, viCountold, viCount;
int iCount1, count2;

void setup()                    // run once, when the sketch starts
{
  pinMode(ledPin, OUTPUT);     // sets the digital pin as output
  TCCR1B = 1<<ICNC1 | 1<<ICES1 | 1<<CS12 | 0<<CS11 | 1<<CS10;

  TIMSK1 = (1 << ICIE1);
  Serial.begin(115200);
  delay(10);
}

void loop()                     // run over and over again
{
  cli();
  iCount1 = viCount;
  sei();
  Serial.print("OLD: ");
  Serial.println(iCount1, DEC);
  digitalWrite(13, state);

}

ISR(TIMER1_CAPT_vect)
{

   TCNT1 = 0;       // reset the counter
   viCount =ICR1; // the count since the same edge on the previous pulse
   state = !state;
}


OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 0 OLD: 92 OLD: 92 OLD: 92 OLD: 92 OLD: 92 OLD: 92 OLD: 94 OLD: 94 OLD: 94 OLD: 94 OLD: 94 OLD: 234 OLD: 234 OLD: 234 OLD: 67 OLD: 67 OLD: 67 OLD: 83 OLD: 83 OLD: 83 OLD: 16 OLD: 16 OLD: 7 OLD: 7 OLD: 127 OLD: 127 OLD: 127 OLD: 204 OLD: 204 OLD: 204 OLD: 204 OLD: 204 OLD: 204 OLD: 204 OLD: 204 OLD: 111 OLD: 111 OLD: 130 OLD: 130 OLD: 3 OLD: 3 OLD: 144 OLD: 144 OLD: 151 OLD: 151 OLD: 20 OLD: 20 OLD: 109 OLD: 109 OLD: 141 OLD: 141 OLD: 165 OLD: 165 OLD: 191 OLD: 191 OLD: 110 OLD: 110 OLD: 211 OLD: 211 OLD: 20 OLD: 20 OLD: 20 OLD: 41 OLD: 41 OLD: 119 OLD: 119 OLD: 21 OLD: 21 OLD: 49 OLD: 49 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195 OLD: 195
8  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts... on: March 09, 2009, 10:31:13 am
hey.. thanx for that..

i still have a problem reading the regs.. i tried wat u suggested. could it be that i am not sending it out right.. could it be that "serial.print is eating up the High byte of my variable..


this is what i have for siplaying the count.. that is after using the code that u suggested previously..

  Serial.println(viCount, DEC);
9  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts... on: March 09, 2009, 07:18:42 am
Hi mem..!!

This is what  have at the moment

Thanx..
 
boolean state = HIGH;
int ledPin = 13;                 // LED connected to digital pin 13
unsigned volatile int viCountnew, viCountold;

void setup()                    // run once, when the sketch starts
{
  pinMode(ledPin, OUTPUT);     // sets the digital pin as output
  TCCR1B = 1<<ICNC1 | 1<<ICES1 | 1<<CS12 | 0<<CS11 | 1<<CS10;

  TIMSK1 = (1 << ICIE1);
  Serial.begin(115200);
  delay(10);
}

void loop()                     // run over and over again
{
  Serial.print("OLD: ");
  Serial.print(viCountold);
  Serial.print("  NEW: ");
  Serial.println(viCountnew);
  digitalWrite(13, state);
//  delay(10);
}

ISR(TIMER1_CAPT_vect)
{
//  cli();
//  TCNT1 =0;
  viCountold = viCountnew;
  viCountnew=ICR1;
  state = !state;
  ICR1 = 0;
//  sei();
  
  
}

10  Forum 2005-2010 (read only) / Syntax & Programs / Re: Interrupts... on: March 08, 2009, 02:28:16 am
Thanx mem...!!
i figured out why i couldn't read the regs. it was because the CS21:0  bits in TCCR1B were configured to stop the timers..!! so then i learnt how to use bitwise OR '|' and i can now read the registers.. however i do have another question.. is 255dec the maximum i can get for a count.. because if i read it correctly in the datasheets, TCNT1 and ICR1 are both 16 bit regs.

this is what i did to be able to read the timers...

  TCCR1B = 1<<ICES1 | 1<<CS10;//

previously i had   TCCR1B = 1<<ICES1 ;


Cheers,
swalehm
11  Forum 2005-2010 (read only) / Syntax & Programs / Interrupts... on: March 08, 2009, 12:17:25 am
Hello...!!

I am a new arduino user and i need some help with interrupts. i was able to get the TIMER INPUT CAPTURE INTERRUPT running by looking at some libraries. whenever there is a change on PB0(pin 8 on the FREEDUINO SB) it triggers the ISR without any issues. i then tried to read the TCNT1 register and the ICR1 registers to know the difference between 2 edges but it doesn't work. anyone with any suggestions??? below is the code i used.

Please help... and Thank you in Advance... smiley


/*
 * This code explores the external interrupts on the Freeduino SB
 * as of 7/03/09 i was able to get the led on and off when there is a
 * rising edge on INPUT CAPTURE1 PORTB0 pin 8 on the Freeduino SB Board.
 * I am still trying to figure out how to read the Timer regs..
 * I succesfully completed the setting up of the ISR and writin an ISR
 */
boolean state = HIGH;
int ledPin = 13;                // LED connected to digital pin 13
unsigned int iCountnew = 0;// iCountold = 0;
void setup()                    // run once, when the sketch starts
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  TCCR1B = 1<<ICES1;
//  iCountnew = ICR1;
  TIMSK1 = (1 << ICIE1);
  Serial.begin(115200);
}

void loop()                     // run over and over again
{
  // Serial.print("OLD: ");
//   Serial.println(int(iCountold));
   Serial.print("NEW: ");
   Serial.println(iCountnew, DEC);
   digitalWrite(13, state);
  
   delay(10);
}

ISR(TIMER1_CAPT_vect)
{
//  iCountold = iCountnew;
  iCountnew=ICR1;
  state = !state;
}


12  Forum 2005-2010 (read only) / Interfacing / Re: Setting Serial Data, Parity and Stop bits. on: January 13, 2010, 08:39:14 pm
Hi

I am using the ArduinoMega with a Serial Servo controller. unfortunately the the servo controller requires 8N2 at 2400 baud. any idea how I can get this ??

I will appreciate any help i can get

Thanx
Maysam
13  Forum 2005-2010 (read only) / Interfacing / two serial devices on: April 17, 2009, 12:21:16 pm
Hi..

I am working on a project that requires me to read a serial device do some calculations and write to another serial device connected to the same board. is this possible by simply using pins 0 and 1 on the board to connect to the two serial devices ?

Thank you in advance

Cheers
14  Forum 2005-2010 (read only) / News / Re: Messenger library on: December 10, 2009, 05:34:48 pm
Hi..

its me again.. i mhaving a different problem this time.. I am trying to control a couple servos through processing.. i send an ascii string as follows to the arduino "int1 int2 int3 int4 int5 int6" and then a carriage return. i receive them and store them in an array i display the array on the LCD.. the trouble is that every so often the first elements and other elements get mixed up and that cause my servos to twitch.. do you know of a fool proof method of receivin an array of integers that would guarantee that the first number received is stored in the first element in the array.??

Thanks
Swalehm
15  Forum 2005-2010 (read only) / News / Re: Messenger library on: December 02, 2009, 04:39:04 pm
Hi.. TOF!!!!!!!

Thanks a lot for your help.. it turns out that the MAX233 was just working one way the other direction was faulty.. i replaced the chip and it works awesomeee!!!

Thanks again for the help and thanks to whoever made the library..

Regards,
Maysam
Pages: [1] 2