Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: Help with atmega1284 on: April 01, 2014, 07:06:20 am
ah,

finalyy, i just pulled all pololu lib files and build with my project, now serial transmission is working fine with pololu.
But my problem remains the same.

That problem was with usart receive data. Transmission code is working good.
2  Using Arduino / Microcontrollers / Re: Help with atmega1284 on: March 29, 2014, 01:56:07 am
Please take a look on my usart api so written -

Code:
Code:

void blinkLed(){
   PORTC |= (1<<INDICATE_LED);
   _delay_ms(50);
   PORTC ^= (1<<INDICATE_LED);
   _delay_ms(50);
}
void usartInit(unsigned char chBaudRate, int uartNum ){
   //12MHz, 77
   switch( uartNum ){
      case 0:
      UBRR0H = (unsigned char)(chBaudRate>>8);
      UBRR0L = (unsigned char)(chBaudRate);
       
      //enable rx and tx 0.
      UCSR0B = (1<<RXEN0)|(1<<TXEN0);
       
      //set frame and stop bit configuration
      UCSR0C = (0<<USBS0)|(3<<UCSZ00);
      break;
      case 1:
      UBRR1H = (unsigned char)(chBaudRate>>8);
      UBRR1L = (unsigned char)(chBaudRate);
       
      //enable rx and tx 0.
      UCSR1B = (1<<RXEN1)|(1<<TXEN1);
       
      //set frame and stop bit configuration
      UCSR1C = (0<<USBS1)|(3<<UCSZ10);
      break;
   }   
}



void sendFromUsart( unsigned char data, int uartPort){
   //wait for empty transmitter buffer.
   switch( uartPort ){
      case 0:
      while( !(UCSR0A&(1<<UDRE0)) );
      UDR0 = data;
      break;
      case 1:
      while( !(UCSR1A&(1<<UDRE1)) );
      UDR1 = data;
      break;
   }
   
}

void sendStringFromUsart(unsigned char *str, int uartPortNum){   
   while( *str )
   sendFromUsart( *str++, uartPortNum);
}

unsigned char* receiveFromUsart(int usartPortNum){
   unsigned char recData;
       
   switch( usartPortNum )  {
      case 0:
         while( !(UCSR0A & (1<<RXC0))){
            blinkLed();
         }
         return (unsigned char)UDR0;
      break;
      case 1:
         while( !(UCSR1A & (1<<RXC1))){
            blinkLed();
         }
         return (unsigned char)UDR1;
      break;
   }
}

-----------------------------------------------------------
Then i changed my code and also incorporated the ISR for RXT on N port,
So please take a look again for next version of code  below.

Code:
void usartInit(unsigned char chBaudRate, int uartNum ){
//12MHz, 77
switch( uartNum ){
case 0:
UBRR0H = (unsigned char)(chBaudRate>>8);
UBRR0L = (unsigned char)(chBaudRate);

//enable rx and tx 0.
UCSR0B = (1<<RXEN0)|(1<<TXEN0);

//set frame and stop bit configuration
UCSR0C = (0<<USBS0)|(3<<UCSZ00);
//
break;
case 1:
UBRR1H = (unsigned char)(chBaudRate>>8);
UBRR1L = (unsigned char)(chBaudRate);

//enable rx and tx 0.
UCSR1B = (1<<RXEN1)|(1<<TXEN1);

//set frame and stop bit configuration
UCSR1C = (0<<USBS1)|(3<<UCSZ10);
//
break;
}
}
void sendFromUsart( unsigned char data, int uartPort){
//wait for empty transmitter buffer.
switch( uartPort ){
case 0:
while( !(UCSR0A&(1<<UDRE0)) );
UDR0 = data;
break;
case 1:
while( !(UCSR1A&(1<<UDRE1)) );
UDR1 = data;
break;
}

}
void usartEableRecieveInt(int nPortNum){
switch( nPortNum ){
case 0:
//enable the rx of usart 0 interrupt.
UCSR0B |= (1<<RXCIE0);
break;
case 1:
//enable the rx of usart 1 interrupt.
UCSR1B |= (1<<RXCIE1);
break;
}
}
void sendStringFromUsart(unsigned char *str, int uartPortNum){
while( *str )
sendFromUsart( *str++, uartPortNum);
}
unsigned char receiveFromUsart(int usartPortNum){
unsigned char recData;
switch( usartPortNum )  {
case 0:
while( !(UCSR0A & (1<<RXC0))){
//blinkLed();
}
recData = UDR0;
return recData;
break;
case 1:
while( !(UCSR1A & (1<<RXC1))){
//blinkLed();
}
recData = UDR1;
return recData;
break;
}
}
void receivedDataNow( unsigned char chData, int nPortFrom){

toggle();
switch( nPortFrom ){
case 0:
//////////////////////////////////////////////////////////////////////////
// received data rom usart 0.
// action code goes here
break;
case 1:
//////////////////////////////////////////////////////////////////////////
// received data from usart 1.
// action ccode goes here
sendFromUsart(chData, 0);
break;
}
}
ISR(USART1_RX_vect){ // Here USART1_RX_vect is defined in headerfile at VECTOR # 28.
// But in atmega1284 datasheet it is defined at VECTOR 29.
//How do i redefine it?
unsigned char chRecvData;
chRecvData = UDR1;
receivedDataNow(chRecvData, 1);
}


So, i have enabled RXENn and that Receive transmission is working when i connect atmega1284 with computer, i can read on RealTerm window with 9600 br.

problem is,
- i am working with sim900 + atmega1284.
now i can send command to sim 900 and it responds wweill, but unable to catch the response from sim900 as RX.

- Aim is to catch the response from sim900 and do some verify-kinda actions.
- And i will remove the blnkLed() to be more immediate to catch response from sim900.

- In code
- Here USART1_RX_vect is defined in headerfile at VECTOR # 28.
- But in atmega1284 datasheet it is defined at VECTOR 29.

For now i am not going with bobuino board. Please help me with getting this correct. Or any library apart from bobuino and pololu, do let me know.

3  Using Arduino / Microcontrollers / Help with atmega1284 on: March 27, 2014, 06:14:58 am
Hi,

this is regarding atmega1284.

Hi,

i am working with Atmega1284. and prblem is with C library.

I am using Pololu library, which is actually writtten for there own product but i think that it should also work with some other atmega1284 setup.

Problem is i am not able to do the usart communication using pololu library.

trying on the other way, tried to write my own code for serial communication on usart, transmitter code done fine, but receive code not working and goes all time for waiting state to receive data.

Code:
unsigned char receiveFromUsart(int usartPortNum){
unsigned char recData;

switch( usartPortNum )  {
case 0:
while( !(UCSR0A & (1<<RXC0))){
blinkLed();
}
recData = UDR0;
return recData;


break;
case 1:
while( !(UCSR1A & (1<<RXC1))){
blinkLed();
}
PORTC &= (0<<INDICATE_LED);
recData =  UDR1;
return recData;
break;
}
}
Please ignore the blinkLed routine call for now, as i put that to monitor the execution point.

My receive code for now.
Please take a look, where i am going wrong with this.

- Is there any other library for atmega1284 <- ("1284").

Thank you.
4  Using Arduino / Sensors / Re: PT100 sensor interface - hardware and software - Help beginner on: January 25, 2014, 03:25:15 am
thank you for your reply.
5  Using Arduino / Project Guidance / Li ion Battery charger - IC on: January 25, 2014, 03:21:06 am

hello,

i am looking for popular( widely used ) Li - ion battery charging IC, or say battery management IC for li ion battery
- battery i want to use with
-- 3.7v
-- 1000mAh ( C )

please suggest me some popular battery management IC
- with auto cutoff
- over charging protection
- simple hardware schematic if possible

As out in market there are many thousands of such IC. but i want expert suggestions, where people have tested and proven such ICs.

If i haven't mentioned some information which are required here regarding this context , please feel free to ask me, i will provide this information so you i can help you in helping me.


Thank you
6  Using Arduino / Sensors / Re: PT100 sensor interface - hardware and software - Help beginner on: January 24, 2014, 09:26:24 am
I even don't know op amp can calibrate the readings or sensor values.

Its just, plan is to get good temperature sensor.
And yes i want to measure temperature accurately.

Any link, space where this whole stuff is already documented, please let me know.

Thanx.
7  Using Arduino / Sensors / PT100 sensor interface - hardware and software - Help beginner on: January 24, 2014, 03:42:57 am

Hi guys,

Please help me in interfacing PT100. I am tossed by google and got many things at same time on my plate.

I am trying to interface it with arduino.
i have PT100 three wire.


If any information is not mentioned above then please ask me to mention so i can help you guys to help me.
8  Using Arduino / Project Guidance / Re: Level interrupt to atmega328, guide me please. on: December 23, 2013, 07:51:08 am

- will this 4060 osc IC give me a level interrupt to atmega328?

/thanx
9  Using Arduino / Project Guidance / Re: Level interrupt to atmega328, guide me please. on: December 21, 2013, 09:54:05 am

Watchdog, this will give me an interval of 8 seconds.

Well, plugging up caps and res of such higher values to 555 timer circuit, is that the best solution?

I am looking for some RTC with alarm facility. But availability of such rtc, finding it bit difficult in INDIA.
People are using RTC DS1307, which is without alarm feature.

Will a alarm programmable RTC will do? If yes then please educate me about that.

Thank You.
10  Using Arduino / Project Guidance / Re: Level interrupt to atmega328, guide me please. on: December 21, 2013, 07:24:49 am
555 timer.... hmmm.
well 555 timer , with
100 uF, R1 = 10kOhms , R2 = 10 kOhms

frequency = 0.481 Hz.
Time High = 1.386 s.   <- - - little higher for a level interrupt.
Cycle time 2.079 s.

but i want a gap of 10 - 20 minutes!!!!!

I think 555 timer will not do.
11  Using Arduino / Project Guidance / Level interrupt to atmega328, guide me please. on: December 21, 2013, 05:56:59 am
          I make my arduino sleep in Power Down mode. And wake it up from INT and watch dog int, oviously these two interrupts are available in power Down mode.
Now i want is, such a level interrupt source which occurs in every 10, 20 minutes and wake my arduino and then after it sleeps back. I am searching for such device which generates level interrupt, or say square signal for 1, 2 seconds to wake up the atmega328.

If this post is similar to some other post then please direct me to there.

Thank You
12  Using Arduino / Displays / Re: Digit LCD, Please identify this for me on: December 19, 2013, 09:26:33 am
#Paul__B, thank you for your reply.

I got this stuff from a local shop, in India. It was just kept away from other components and no body was looking at it. smiley-sad

I just got this under 1 $ , exact amount in India is 50 INR only.

Yes, last two pin are VCC and GND.
But other pins how can i fugure it out?

Please take a look on Display. It has one side 40 pin running. One other edge, it has 4, 4 pins as set.

Please, if somebody used such display earlier, please help me understanding an approach to learn such unique components.

/Thanx
13  Using Arduino / Displays / Digit LCD, Please identify this for me on: December 18, 2013, 01:09:03 pm
Hi guys,

Please help me in identifying this digit LCD. I am searching for

- I am looking for Datasheet to drive this.
- Looking for pin configurations.


I am attaching images of the Digit LCD below.

Thanx
14  Using Arduino / Displays / Re: Low Power Display Unit on: December 05, 2013, 06:16:43 am

thanx for quick reply

But from here https://www.sparkfun.com/datasheets/LCD/GDM1602K-Extended.pdf in pg 3, under DC characteristics
its written 1.5 - 2.5 mA.

Its my mistake i was considering values against wrong attibutes.


Now thing is The current is in Milli Amps.

Are you sure that the LCD ( generic ) (16x2 or 20 x 4 ) draws 200uA as its functional requirement?
Please provide me link for the same so i will read the informations.

/thanx
15  Using Arduino / Displays / Low Power Display Unit on: December 05, 2013, 05:48:27 am
Hi guys,

I am looking for low power display device which i can interface with atmega328/168.


# You can suggest me taking arduino as under consideration.
# Low power
  # low in Voltage supply.
  # low in current consumption.
  # low in power dissipation.

# Issues with 16x2 LCD
  # Draws logic supply current nearly 200mA which is reallly high for me.

# Issues with 3 1/2 Digit display is
  # Such displays are static displays. ( static ? )
  # static means ones lines state is changed the display will change accordingly, as no controller is embedded with it!!! am i correct?!

Guys i want such dissplay whose current consumptiona and voltage supply as low as < = 3.0 v, and in 1-10 mA or less.


Thanx
/Annim
Pages: [1] 2