Changeset 6390cc3 in avrstuff for chiptest


Ignore:
Timestamp:
Sep 24, 2017, 7:39:05 PM (7 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
6c47e45
Parents:
9a9d5d0
git-author:
Adrien Destugues <pulkomandy@…> (24/09/2017 17:13:58)
git-committer:
Adrien Destugues <pulkomandy@…> (24/09/2017 19:39:05)
Message:

chiptest: Start to hack on ATmega128 and STK500 devboard.

  • Set the proper clock for it (generated by the STK500 master MCU, did

not get crystal working reliably yet)

  • Instead of just 'H', generate the whole alphabet for more action!
  • Use ATmega128 since that's what happens to be seated on my board for

now.

Location:
chiptest
Files:
1 deleted
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • chiptest/Makefile

    r9a9d5d0 r6390cc3  
     1# STK500
     2F_CPU=3800000
     3MCU=atmega128
     4
    15# K4KUSB
    2 F_CPU=12000000
     6#F_CPU=12000000
     7#MCU=attiny2313
    38
    49# muSerial
    510# F_CPU=20000000
     11#MCU=attiny2313
    612
    713# Common
    8 MCU=attiny2313
    914BAUD=9600
    1015
     
    1318include ../kbd/common.mk
    1419
    15 COMPILE = $(CC) -Wall -Os -std=c99 -mmcu=$(MCU) -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) \
    16         -I../libs/usart/
     20COMPILE = $(CC) -Wall -std=c99 $(CFLAGS) -I../libs/usart/
    1721
    1822VPATH=../libs/usart/
     
    2024#Rules
    2125
    22 blinkdel.bin: main.o usart.o
     26$(MCU).bin: main.o usart.o
    2327        $(COMPILE) $^ -o $@
    2428
     
    3337        $(COMPILE) -std=c99 -c $< -o $@
    3438
    35 flash:
    36         avrdude -c usbasp -p $(MCU) -Uflash:w:blinkdel.hex
    37 
  • chiptest/main.c

    r9a9d5d0 r6390cc3  
    1212// muSerial: ATTiny2313 - LED = PD6
    1313// K4KUSB: ATTiny2313 - LED = PB2
    14 #define DDRLED DDRB
    15 #define PORTLED PORTB
    16 #define LEDBIT (1 << PB2)
    17 
    18 #define BAUD 9600 // Safe value even for low clocks. (used by setbaud.h)
     14// STK500: anything, PORTD is convenient if available.
     15#define DDRLED DDRC
     16#define PORTLED PORTC
     17#define LEDBIT (1 << PC2)
    1918
    2019int main() {
    2120        wdt_enable(WDTO_2S);
    2221    // configure timer 0 for a rate of FCPU/(256 * 256)
     22#ifdef __AVR_ATtiny2313__
    2323    TCCR0A = 0;          // timer 0 prescaler: 256
    2424        TCCR0B = 4;
     25#else
     26        TCCR0 = 6; // timer 0 prescaler: 256
     27#endif
    2528
    2629        //debug LED - output
     
    3235        // Let's rock!
    3336        uint8_t counter = 0;
     37        char c = 'a';
    3438        for(;;) {
    3539                wdt_reset();
     
    4347                        {
    4448                                PORTLED ^= LEDBIT; // Toggle the LED
    45                                 USARTWriteChar('H'); // Send a byte to the UART
     49                                USARTWriteChar(c++); // Send a byte to the UART
     50                                if (c > 'z')
     51                                        c = 'a';
    4652                        }
    4753                }
  • chiptest/readme.md

    r9a9d5d0 r6390cc3  
    1111Right now chiptest supports the following devices:
    1212* ATTiny2313.
     13* ATmega128
    1314
    1415It tests the following features:
Note: See TracChangeset for help on using the changeset viewer.