Let's Make Robots!

atmega32 INT2

djhesit8's picture

Hi...

 

I have an atmega 32... I want to use all of the 3 interrupts... I got problems with INT2...

 

I set it up as a falling edge and via a 10K resistor put the button to ground...

 

while(bit_is_set(PINB, PB2));

_delay_ms(5000);

//init interupt

GICR |= (1<<INT0) | (1<<INT1) | (<<INT2);

sei();

 

 

 

the problem is that after the while... when the interrupts are initialized... the pull-up drops out...

Battery charging

djhesit8's picture

Hello

 

I have this battery:

it has 6V, 1.3Ah... I don't have a charger... on the side says:

 

cycle use charge 7.25 - 7.45V

Trickle charge: 6.8 - 6.9V

and something about 0.4A

 

avr 38khz modulation problems

djhesit8's picture

Hello guys...

 

I have some troubles... I take a look at AVR Calc and at 8mhz I can make a CTC of around 37.98khz signal wich lets say would be ok for 38... the problem is that there is not enough explanation of how to make it...

 

for 8mhz, 1 prescaller, ,on 8 bit timer:

OCR = 0xD2

TCNT Base = 0x2D

CTC = 37.9147khz

Error = -0.224%

overflow: 32.000 uSec

PWM normal/fast = 31250.000 hz

pwm phase correct 15686.274hz

 

 

can you please help me how to set the code for this?

L293D not working even if its wired correct

djhesit8's picture

hi...

 

I have an L293D driver... I connect logic VSS from regulated 5V and the atmega8 too... the VS is connected through another 5V regulated voltage... it drives a little motor... but it doesn-t drive my tamiya box... everything is set up correctly and tested... why is this? when I measure the voltage on the motor pins it goes 4.95V and -4.95 every 5 seconds as it should go... but after I connect the motors and remove them, I measure again, I got 0.02 and -0.02... whats the problem?

phototransistor problem

djhesit8's picture

hi

 

I used to have my QRD1114 with a 10K pull-up resistor and everything was fine... but look I replaced it with IR emitter and IR receiver/phototransistor... I put a 12K pull-up to 5V on the collector, and between the collector and the resistor I get the signal... but I got only around 1.4 - 1.6 why?

 

Any simple ideeas?

AVR UART not really working

djhesit8's picture

hello...

 

I'm still developing a code here...

 

can somebody test it out somehow?

 

I don't know what is the problem

 

the reciever or the transmitter

 

 

here is the code for the reciever:

 

 

tiny2313 pwm timer1 does not work the OCR1A and OCR1B

djhesit8's picture

Hello

 

I want to control 2 DC motors...

 

I set the Timer1 for fast pwm no problem... I run at 4 mhz....

 

what prescaller I need?

and even if I set the OCR1A and OCR1B the speed is constant... any ideea?

 

 

thanks

 

TCCR1A |= (1<<WGM10)|(1<<WGM11)|(1<<COM1B1)|(1<<COM1B0)|(1<<COM1A1)|(1<<COM1A0);

TCCR1B |= (1<<CS11)|(1<<WGM13)|(1<<WGM12); //prescaller

Hi hi...   This is my new robot with implemented PID control for line following...   It uses 5 QRD1114... firstly I used 3 but I thoutgh that wasn't working than … Read more
Flashes four 7-segment display which forms the word: "LOVE"
Hi guys...   I saw a blog about a cool project. It is powered from USB and simply displays the word "LOVE"... I was thinking about adding more dinamics because I … Read more
 Hi everybody, This is somewhat a tutorial, so here I wanna present you some information about ATmel's processors, and I will present those two chips that I am … Read more