Loading...
  Show Posts
Pages: [1] 2 3 ... 48
1  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: May 19, 2013, 12:13:42 pm
Replace wiring.h with:
Code:
/*
*** Core13 ***
Arduino core designed for Attiny13 and similar devices.
NO WARRANTEE OR GUARANTEES!
Written by John "smeezekitty"
You are free to use, redistribute and modify at will EXCEPT IF MARKED OTHERWISE IN A PARTICULAR SOURCE FILE!
Version 0.19
*/
#ifndef Wiring_h
#define Wiring_h
#include <avr/io.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C"{
#endif
#define HIGH 1
#define LOW 0
#define INPUT 0
#define OUTPUT 1
#define false 0
#define FALSE 0
#define TRUE 1
#define true 1
#define PI 3.1416
#define HALF_PI 1.57
#define TWO_PI 6.283
#define DEG_TO_RAD 0.0174533
#define RAD_TO_DEG 57.2958
#define SERIAL 0
#define DISPLAY 1 //WTF are these?
#define LSBFIRST 0
#define MSBFIRST 1
#define CHANGE 1
#define FALLING 2
#define RISING 3
#define INTERNAL 1
#define EXTERNAL 0
#define DEFAULT 0
#ifdef abs
#undef abs
#endif
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x)     ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))
#define interrupts() sei()
#define noInterrupts() cli()
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
#define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L )
#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define highByte(w) ((uint8_t) ((w) >> 8))
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
typedef unsigned int word;
#define bit(b) (1UL << (b))
typedef uint8_t boolean;
typedef uint8_t byte;
void init(void);
void pinMode(uint8_t, uint8_t);
void digitalWrite(uint8_t, uint8_t);
uint8_t digitalRead(uint8_t);
int analogRead(uint8_t);
void analogReference(uint8_t mode);
void analogWrite(uint8_t, uint8_t);
unsigned long millis(void);
unsigned long micros(void);
void delay(unsigned ms);
void delayMicroseconds(unsigned int us);
void shiftOut(uint8_t, uint8_t, uint8_t, uint8_t);
uint8_t shiftIn(uint8_t, uint8_t, uint8_t);
unsigned long pulseIn(unsigned char pin, unsigned char stat, unsigned long timeout);
//void attachInterrupt(uint8_t, void (*)(void), int mode);
//void detachInterrupt(uint8_t);
void setup(void);
void loop(void);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

The EEPROM library is just a thin wrapper around avr-libc so it should work but could be large.
2  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: May 18, 2013, 09:50:24 pm
is there any way to solve this issue?  smiley-cry

can I write the code that correspond to analogReference() directly in the Arduino sketch?

Thanks in advance
No need. After you make the minor corrections in the wiring.h it will work. Will be fixed in version 0.19
3  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: May 18, 2013, 12:40:13 pm
Quote
This is very strange. I am using version 18. The same code can be compiled for Attint85, but it does not work for Attiny13. That means that it is correctly spelled. The code that fails follows:

void setup() {
 analogReference(INTERNAL);
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);

 time = millis();
memooculto = EEPROM.read(0); delay(80);
 if (memooculto == 0) { maxmodereal = maxoculto;}
 else  {maxmodereal = maxmode;}
 
mode = EEPROM.read(1);
delay(80);
if (mode == 0) {mode = 1;}
if (mode > maxmodereal) {mode = maxmodereal;}
 }
I confirmed there is a problem with wiring.h. You need to uncomment analogReference() and change #define INTERNAL to something other then zero.

But unless you have another library, EEPROM functions won't work.
4  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: May 18, 2013, 03:04:32 am
One question about using the internal voltage reference...

Is it implemented? in which pin?

Could you please show me how to use it in this Arduino core?

I am employing analogReference(INTERNAL) and I obtain the following error:

"AnalogReference was not declared...."

Please, if it is not implemented, I really need it for my project. and it must be the internal reference.  smiley-cry

Thanks in advance
The two references supported are ~1.1v and VIN. External reference is not supported in hardware.

Make sure analogReference is spelled right. Make sure the core is installed properly. Before version 0.18 analogReference was stub so make sure you update.
5  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: May 16, 2013, 02:12:27 am
Internal clocks, being RC oscillators won't be too accurate.
They are not really stable over varying voltage either. Good enough for many cases though.
6  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: May 07, 2013, 07:32:56 pm
Yes that is correct PB0 and PB1 support PWM. PWM is fully implemented although the next version should improve PWM performance.
7  Using Arduino / Installation & Troubleshooting / Re: Arduino stops compiling halfway through??!! on: April 22, 2013, 10:44:34 pm
A bad hard disk wouldn't cause high fan speed. Perhaps your CPU cooler isn't seated well and it is overheating.

Can you check your temperatures?
8  Using Arduino / Microcontrollers / Re: Is atmega damaged or not? on: April 19, 2013, 10:07:14 pm
Wow that is really lucky. I accidentally inserted an SRAM chip backwards and the PTC on the Arduino triggered and the voltage sagged to ~1V.

Amazingly the chip survived thanks to the fuse.
9  Using Arduino / Microcontrollers / Re: Is atmega damaged or not? on: April 19, 2013, 07:18:49 pm
Atmega backwards? That could certainly cause high current usage.
10  Using Arduino / Installation & Troubleshooting / Re: adapter usb 5v ok, adapter 9v causes problems on: April 19, 2013, 06:52:15 pm
To me, it sounds like excessive ripple is getting through. Can you try a different adapter?
11  Using Arduino / Installation & Troubleshooting / Re: Compilation became incredibly slow on: April 19, 2013, 06:49:27 pm
What kind of CPU and how much RAM? Can you watch task manager while compiling?
12  Using Arduino / Programming Questions / Re: LED on pin 13 always on on: April 19, 2013, 06:41:30 pm
Honestly it might be a melted atmega168. Are the TX/RX lights stuck on?
13  Using Arduino / Installation & Troubleshooting / Re: Arduino stops compiling halfway through??!! on: April 19, 2013, 06:36:20 pm
What kind of CPU and how much RAM do you have?
14  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: March 23, 2013, 12:34:44 pm

Sorry for the slow response.

http://sourceforge.net/projects/ard-core13/files/
15  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: March 20, 2013, 09:20:16 pm
Is the newest core called 017 ?

I downloaded from the link in the first post in this thread
No, the new version is 0.18.
Pages: [1] 2 3 ... 48