/*****************************************************
This program was produced by the
CodeWizardAVR V2.05.3 Standard
Automatic Program Generator
© Copyright 1998-2011 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project :
Version :
Date : 2012-11-19
Author : Negaran
Company :
Comments:
Chip type : ATtiny13
AVR Core Clock frequency: 1.200000 MHz
Memory model : Tiny
External RAM size : 0
Data Stack size : 16
*****************************************************/
#include <tiny13.h>
#include <delay.h>
// Declare your global variables here
void main(void)
{
// Declare your local variables here
// Crystal Oscillator division factor: 8
#pragma optsize-
CLKPR=0x80;
CLKPR=0x03;
#ifdef _OPTIMIZE_SIZE_
#pragma optsize+
#endif
// Input/Output Ports initialization
// Port B initialization
// Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out
// State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTB=0x00;
DDRB=0x0F;
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=0xFF
// OC0A output: Disconnected
// OC0B output: Disconnected
TCCR0A=0x00;
TCCR0B=0x00;
TCNT0=0x00;
OCR0A=0x00;
OCR0B=0x00;
// External Interrupt(s) initialization
// INT0: Off
// Interrupt on any change on pins PCINT0-5: Off
GIMSK=0x00;
MCUCR=0x00;
// Timer/Counter 0 Interrupt(s) initialization
TIMSK0=0x00;
// Analog Comparator initialization
// Analog Comparator: Off
ACSR=0x80;
ADCSRB=0x00;
DIDR0=0x00;
// ADC initialization
// ADC disabled
ADCSRA=0x00;
PORTB=0b001010;
while(1);
}
thanks for this info, I didnt know about PUD bit in MCUCR register.. whats its function exactly?try adding
this should disable any accidental pull-ups...Rich (BB code):MCUCR = 0x40
also, your while(1) might be optimized out....
PUD disables pull-ups, regardless of port configuration....thanks for this info, I didnt know about PUD bit in MCUCR register.. whats its function exactly?
I tried this, noting was changed, so know Im almost sure that the chip is damaged or programmer doesn't work correctly
I really dont understand this , that why the output must be in switching mode?? it should be simple 0 voltsWhat he meant was that the output could be switching faster than you can see.. also, a DVM measuring VDC will average your result... 50% duty cycle = 1/2Vmax which would explain your 2.5V output...
I believe it was a reference to when you said you wanted to flash LEDs. Also, if your while(1) is, indeed, being optimized out, it is possible that your controller resets, making an output set to 1 appear as 2.5V....I really dont understand this , that why the output must be in switching mode?? it should be simple 0 voltsI'm really confused , friends.
| Thread starter | Similar threads | Forum | Replies | Date |
|---|---|---|---|---|
|
|
Vishay Dale IFSC1515AHER470M01 Marking Problem | Test & Measurement | 0 | |
| A | How do I solve this problem using Kirchhoff's laws, everyone? | Homework Help | 17 | |
|
|
Bosch oven problem | Technical Repair | 4 | |
|
|
Problem with powering DIY boost converter | Power Electronics | 7 | |
|
|
Toy car circuit problem | General Electronics Chat | 17 |