Сам с CodeVision пока никак, уровень могу прошить AVR на программаторе tl866. Просьба, нужен HEX или BIN и как поставить фьюзы.
У меня не получается устройство работает, но не правильно.
HEX есть в архиве, прошивайте удобным вам методом. Фьюзы - выставить на работу от внутренего генератора на 8 МГц.
Добавлено after 17 minutes 55 seconds:Всем доброго дня!
Поставил себе задачу впихнуть в ATTiny13A программу сбора показаний с нескольких DS18b20 и передачу из по UART.
Помощник CVAVR сделал все необходимые первичные настройки, активировал 1-wire и тд, но даже без UARTa компилятор ругается на недостаток RAM (
Linker error: global RAM variables size: 81 bytes is too large) ! Я просто выхожу из мастера генерации кода и пробую всё собрать!
Спойлер
Build configuration: Release
Chip: ATtiny13A
Clock frequency: 1,200000 MHz
Memory model: Tiny
Optimize for: Size
(s)printf features: int, width
(s)scanf features: int, width
Promote 'char' to 'int': Yes
'char' is unsigned: Yes
global 'const' stored in FLASH: Yes
8 bit enums: Yes
Enhanced function parameters passing: Yes
Automatic register allocation: Yes
Build: 7
764 line(s) compiled
1 error(s)
No warnings
Bit variables size: 0 byte(s)
Data Stack area: 0x60 to 0x6F
Data Stack size: 16 byte(s)
Estimated Data Stack usage: 0 byte(s)
RAM Global variables area: 0x70 to 0xC0
RAM Global variables size: 81 byte(s)
Hardware Stack area: 0xC1 to 0x9F
Hardware Stack size: -33 byte(s)
Heap size: 0 byte(s)
EEPROM usage: 0 byte(s), 0,0% of EEPROMЧестно сказать, я в замешательстве, ведь у многих работает (судя по статьям в интернете), правда все делают для одного датчика...
У меня задача использовать несколько, максимально возможное количество.
Попробовал уменьшить дефайн
MAX_DS1820 ... при "2" - проект собирается:
Спойлер
Build configuration: Release
Chip: ATtiny13A
Clock frequency: 1,200000 MHz
Memory model: Tiny
Optimize for: Size
(s)printf features: int, width
(s)scanf features: int, width
Promote 'char' to 'int': Yes
'char' is unsigned: Yes
global 'const' stored in FLASH: Yes
8 bit enums: Yes
Enhanced function parameters passing: Yes
Automatic register allocation: Yes
Build: 6
764 line(s) compiled
No errors
No warnings
Bit variables size: 0 byte(s)
Data Stack area: 0x60 to 0x6F
Data Stack size: 16 byte(s)
Estimated Data Stack usage: 0 byte(s)
RAM Global variables area: 0x70 to 0x8A
RAM Global variables size: 27 byte(s)
Hardware Stack area: 0x8B to 0x9F
Hardware Stack size: 21 byte(s)
Heap size: 0 byte(s)
EEPROM usage: 0 byte(s), 0,0% of EEPROM
Program size: 226 words (452 bytes), 44,1% of FLASH
0 words (0 bytes), 0,0% reduced by Code Compression Может какие настройки в компиляторе нужно сделать?Пустая программа, которая не помещается:
Спойлер
Код: Выделить всё
/*******************************************************
This program was created by the
CodeWizardAVR V3.12 Advanced
Automatic Program Generator
Chip type : ATtiny13A
AVR Core Clock frequency: 1,200000 MHz 9.6 Mhz / 8 preskaller
Memory model : Tiny
External RAM size : 0
Data Stack size : 16
*******************************************************/
#include <tiny13a.h>
// 1 Wire Bus interface functions
#include <1wire.h>
// DS1820 Temperature Sensor functions
#include <ds1820.h>
// maximum number of DS1820 devices
// connected to the 1 Wire bus
#define MAX_DS1820 8
// number of DS1820 devices
// connected to the 1 Wire bus
unsigned char ds1820_devices;
// DS1820 devices ROM code storage area,
// 9 bytes are used for each device
// (see the w1_search function description in the help)
unsigned char ds1820_rom_codes[MAX_DS1820][9];
// Declare your global variables here
void main(void)
{
// Declare your local variables here
// Crystal Oscillator division factor: 1
#pragma optsize-
CLKPR=(1<<CLKPCE);
CLKPR=(0<<CLKPCE) | (0<<CLKPS3) | (0<<CLKPS2) | (0<<CLKPS1) | (0<<CLKPS0);
#ifdef _OPTIMIZE_SIZE_
#pragma optsize+
#endif
// Input/Output Ports initialization
// Port B initialization
// Function: Bit5=In Bit4=In Bit3=In Bit2=In Bit1=In Bit0=In
DDRB=(0<<DDB5) | (0<<DDB4) | (0<<DDB3) | (0<<DDB2) | (0<<DDB1) | (0<<DDB0);
// State: Bit5=T Bit4=T Bit3=T Bit2=T Bit1=T Bit0=T
PORTB=(0<<PORTB5) | (0<<PORTB4) | (0<<PORTB3) | (0<<PORTB2) | (0<<PORTB1) | (0<<PORTB0);
// 1 Wire Bus initialization
// 1 Wire Data port: PORTB
// 1 Wire Data bit: 4
// Note: 1 Wire port settings are specified in the
// Project|Configure|C Compiler|Libraries|1 Wire menu.
w1_init();
// Determine the number of DS1820 devices
// connected to the 1 Wire bus
ds1820_devices = w1_search(0xf0,ds1820_rom_codes);
while (1)
{
// Place your code here
}
}
UPD: думаю мне понятно...
9 bytes are used for each device ... 8 устройств Х 9 байт = 72 байта, что уже больше 64 имеющихся в Тиньке...