ISP-programmer to AVR synchronisation

AVR ISP-programming starts with RESET activation following by transmitting of programming enable instruction. Entry sequence requirement is that SCK must be set to ‘0’ during RESET activation. Otherwise SCK falling edge causes unintended programming hardware state change.

AVR programming waveforms

The falling edge distorts 4-byte programming instruction. The microcontroller does not recognise it and does not enter programming mode. There is no sense to send programming entry instruction again because byte-level command’s phase is shifted by one SCK period. The last SCK pulse of previous instruction will act as extra pulse for subsequent command.

Synchronisation can also be corrupted during programming process. Read more in publication about AVReAl “synchronisation lost” message.

Atmel datasheets describe two methods for synchronisation recovery.

»»» Read more about resynchronisation[/lаng_en]

AVReAl beta — 1.28r9b1

avreal beta-version 1.28r9b1 with FT232H support has been released.
Please, test it.


Update: testing done, thanks.

AVReAl 1.28r8 / FreeBSD

avreal v.1.28r8 and older ones were built for FreeBSD 6.4.
avreal1.28r8 was rebuilt for FreeBSD 8.2 then tested and uploaded to avreal download page.

All future versions will be built for FreeBSD 8.2 only.

AVReAl update — 1.28r8

avreal v1.28r8 (Sat 2011-08-13) has been released.

  • Raw binary file support is added.
    Binary files are denoted by :bin: prefix in file name.
  • -r switch behavior is changed.
    -r+ forces writing full memory content into output file (“old” behavior of -r).
    When -r is used, rows which contain only FF bytes in data field will not be written into :ihex: output file. FF-only tail will not be written into :bin: file.

GCC sections usage

I am sorry, this text in English does not exist (yet).
I apologized there. Try google translate.

Нехай перед нами стоїть наступна задача. Програма може складатися з набору модулів, які комбінуються в залежності від потреб. Кожен модуль має функцію, яка викликається при його виборі в простому меню на терміналі. Також є текстовий рядок та літера для меню. Ми хочемо автоматизувати процес збирання програми таким чином, що при підключення модуля в проект він «сам» ініціалізується і «реєструється» в програмі до початку роботи main(). В C++ це робиться за допомогою конструкторів, але при цьому розмір програми росте. В C можна в окремому файлі створити масив структур опису модулів і ініціалізувати його статично. Щоправда, при цьому доведеться ініціалізувати модулі окремим циклом на початку функції main() (теж трохи додаткового коду) та для формування масиву залежно від потреб використовувати #ifdef / #endif.

Зрозуміло, якщо «з першого акту на стіні висить рушниця» моделі «використання секцій», то тут стрілятиме саме вона.
Читати далі — автоматизація реєстрації модулів за допомогою секцій… » » »

Attached Files:

  • zip GCC sections usage demo

    avr-gcc, atmega168. Code::Blocks project with external makefile (can be used with any IDE or without IDE)

avr-gcc .init sections

I am sorry, this text in English does not exist (yet).
I offer exuses here. Try google translate.

Для програм, написаних мовою С чи С++, часто буває зручно, а іноді просто необхідно проініціалізувати якісь ресурси мікроконтролера до початку роботи фунцкії main() (для C++ — до початку роботи конструкторів статичних об’єктів). В багатьох системах програмування для цього використовується функція на зразок low_level_init(), яка викликається з С-шного «пускача» (start-up module, в більшості випадків пишеться на асембелрі) і має бути визначеною десь в проекті. Якщо такої функції нема, тобто програміст її не написав у даному проекті, то з бібліотеки береться коротка «затичка» (stub), яка просто нічого не робить.

У avr-gcc це зроблено дещо по-іншому. Використовуються можливості системи програмування по обробці секцій (сегментів, sections, segments) програми. Вашій увазі пропонується невеличкий приклад з детальним описом.
Continue reading ‘avr-gcc .init sections’ »

Attached Files:

Розчистка завалів

В результаті невеликого наведення порядку (чи то наведення невеликого порядку) відгреблося в сторону і готове потрапити в добрі руки:

P80C31BH (DIP-40) 1
P80C51FA (DIP-40) 1
D87C51FA (CERDIP-40) 1
AT89C52-12PI (DIP-40) 1
AT89C55-24PI (DIP-40) 2
AT89C55-33PI (DIP-40) 1
AT89C51-24JC (PLCC-44) 1
AT89C51RC-24JI (PLCC-44) 1
AT90S8515-8JI (PLCC-44) 3
T89C51RD2-IM (PLCC-44)
1
Scenix SX28AC/DP 1
FM1608-P (DIP-28)
2 (зарезервовано)
HY6264ALP-10 (15мм DIP)
1 (зарезервовано)
2
27C64, 27C256, 27C1001 (CERDIP) Не рахував

Все це не паяне, але половина з цього побувала в панельках 🙂
Мікроконтролери та EPROM-ки перешивалося не багато разів (а деякі взагалі не зашивалися), так що ресурс ще не вичерпано.

Крім того є здуте з плат, які йшли на викидання. Має бути робочим:

MSP430F1101 5 (зарезервовано 3)
MSP430F1101A 11 (зарезервовано 5)

З ними якась кількість кварців 32768 Гц в корпусах TC-28.

Все роздається.

AVReAl update — 1.28r7

avreal v1.28r7 (Sun 2011-02-27) has been released.

bug in -v+ switch processing

-v+ switch (-v switch with + modifier) is incorrectly processed by avreal versions from 1.28r2 to 1.28r6.
avreal checks for 0xFF all memory locations instead of ones unused in HEX-file.
That way avreal stops work after verification and rejects subsequent operations, for example, fuse write command.

-v switch without modifier is processed properly so it is recommended to use it.
The bug is not critical. Bugfix will be later.


The bug has been fixed in version 1.28r7.

AVReAl update — 1.28r5

avreal v1.28r5 (Tue 2010-10-12) has been released.

  • Synchronisation lost after verification for FT2232/FT4232-based adapters — fixed.
  • ATmega128RFA1 added
[flagcounter image]