Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Hello,
I read a temperature from sensor 18b20 with ATmega32 like this:
unsigned long i;
unsigned char m;
io_init();
delay_ms((unsigned char)1600);
ds1820_reset();
while(1)
{
ds1820_start();
i = ds1820_read_temp();
i = (i * 1000) / 16...
OK, now I see that.
Since I am unexperienced in AVR programming it takes me several days to get this simple example working and nobody say this before.
Now problem is fixed and I can go forward.
Thanks for help again.
nime.
You can see in my post from "08-07-13, 19:52".
Global variable 'int ininterrupt' should be declared as 'volatile int ininterrupt'.
Such way showed program become to behave as expected.
I finally find cause of those troubles.
For GCC - Integer 'ininterrupt' should be declared globally but should be declared as 'volatile' also.
That should be done so for all other interrupts in order to work.
Now (finally) my program, board and all chips work as expected from windows and linux...
I noted that by comparing led switching with seconds on the wall watch!
So, this is reason for that!
I will ty later to write fuse bits properly.
As I can see, here is only INT0 and INT1 ports.
I try both.
Since chip is in ZIF socket I twist those pins to fly unconnected then try to trigger...
No, no usable schematic.
Now I create fresh project.
Here is my codeblocks project listing:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="int0" />
<Option pch_mode="2" />
<Option...
I read much before asking for a help here.
Now I try with totally new chip and I have same result.
Also I changed to GICR|=1<<INT0; again with same result.
I think now that most logical is that my board isn't correct or is damaged somehow.
Unfortunatelly, I haven't debugger to see where and...
Thanks for code, I replaced that line.
When I press INT0 button portB becames 11111101 every time for a short period of time.
When I connect pin 16 to vcc or gnd nothing happens, with resistor or without it.
Crystal is 7.3728.
This is one ready maded board from ebay and may contain an error.
May I somehow test interrupt by do a shortcuircut from INT0 (pin 16) to vcc or GND?
Hi jayanth,
I do like you suggest and program work same as before (ISR don't work).
Sorry for braces, error while copying.
Code now:
#define F_CPU 7372800
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#define DataPort PORTB
#define DataDDR DDRB
int ininterrupt...
Hello,
As absolute beginner to AVR microcontrollers I try several examples from net in order to fire interrupt 0 on ATMEGA 32.
I try approach from here:
http://www.avr-tutorials.com/interrupts/avr-external-interrupt-c-programming
But as other examples this one also don't work in my case.
Here...
Hello,
This is my first try with AVR microcontrollers and I never before uses it so please "basic type" of explanation.
I get this AVR test board:
**broken link removed**
Inside is some test program in ATmega32 chip which is running on power on.
and this debugger/programmer:
**broken link...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.