Авг 302013
 

Вот решил сотворить себе Arduino Leonardo на ATmega32U4 — вот что получилось.

Все работает.

Схему взял тут: https://www.sparkfun.com/products/11098

Leonardo-Atmega32u4-by-home

Bootloader загружал через Arduino 1.0.5 (USBtinyISP)

Вот как видит его Ubuntu.

[181406.221727] tty_port_close_start: tty->count = 1 port count = 0.
[181406.336104] usb 2-2: USB disconnect, address 28
[181406.680048] usb 2-2: new full speed USB device using uhci_hcd and address 29
[181406.863091] cdc_acm 2-2:1.0: ttyACM0: USB ACM device
[181409.672104] usb 2-2: USB disconnect, address 29
[181409.912056] usb 2-2: new full speed USB device using uhci_hcd and address 30
[181410.092978] cdc_acm 2-2:1.0: This device cannot do calls on its own. It is not a modem.
[181410.093045] cdc_acm 2-2:1.0: ttyACM0: USB ACM device
[181410.101921] input: Arduino LLC Arduino Leonardo as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.2/input/input16
[181410.102456] generic-usb 0003:2341:8036.000D: input,hidraw3: USB HID v1.01 Mouse [Arduino LLC Arduino Leonardo] on usb-0000:00:1d.0-2/input2

32U4PinMapping

 Posted by at 01:04
Янв 242013
 

my_arduino_atmega32_cp2102

                               ATMEL ATmega32
					   
                                  +---\\---+
 	   (XCK/T0) D0 PB0	01|        |40  PA0 AI7 D31 (ADC0)
 	       (T1) D1 PB1	02|        |39  PA1 AI6 D30 (ADC1)
 	(INT2/AIN0) D2 PB2	03|        |38  PA2 AI5 D29 (ADC2)
 	 (OC0/AIN1) D3 PB3	04|        |37  PA3 AI4 D28 (ADC3)
	       (SS) D4 PB4	05|        |36  PA4 AI3 D27 (ADC4)
	     (MOSI) D5 PB5	06|        |35  PA5 AI2 D26 (ADC5)
	     (MISO) D6 PB6	07|        |34  PA6 AI1 D25 (ADC6)
	      (SCK) D7 PB7	08|        |33  PA7 AI0 D24 (ADC7)
                   RESET	09|        |32  AREF
                     VCC	10|        |31  GND
                     GND	11|        |30  AVCC
                   XTAL2	12|        |29  PC7 D23 (TOSC2)
                   XTAL1	13|        |28  PC6 D22 (TOSC1)
            (RXD) D8 PD0	14|        |27  PC5 D21 (TDI)
            (TXD) D9 PD1	15|        |26  PC4 D20 (TDO)
          (INT0) D10 PD2	16|        |25  PC3 D19 (TMS)
          (INT1) D11 PD3	17|        |24  PC2 D18 (TCK)
          (OC1B) D12 PD4	18|        |23  PC1 D17 (SDA)
          (OC1A) D13 PD5	19|        |22  PC0 D16 (SCL)
          (ICP1) D14 PD6	20|        |21  PD7 D15 (OC2)
                                  +--------+

 

Arduino на Atmega32A — 16 Mhz — собрал вот такую Ардуинку,  залил туда bootloader Arduino. Все отлично работает. Собрал также USB-UART модуль на CP2102.

Источник: http://www.instructables.com/id/Using-Atmega32-with-Arduino-IDE/

  1. Download project https://github.com/eaconner/ATmega32-Arduino/archive/master.zip or zip file attached to this instructables.
  2. Locate file boards.txt in arduino folder …arduino-1.5.2\hardware\arduino\avr\boards.txt
  3. Append information from zip archive boards.txt to original boards.txt
  4. Make a folder named mega32 in …arduino-1.5.2\hardware\arduino\avr\variants
  5. Copy file pins_arduino.h from the zip into folder created at step 4.
  6. Start Arduino IDE and select board.
  7. Select programmer

ATmega32-Arduino-master


mega32-16.name=ATmega32-External 16mhz
mega32-16.upload.protocol=arduino
mega32-16.upload.speed=19200
mega32-16.upload.maximum_size=32000
mega32-16.build.mcu=atmega32
mega32-16.build.f_cpu=16000000L
mega32-16.build.core=arduino:arduino
mega32-16.build.variant=mega32
mega32-16.bootloader.low_fuses=0xEF
mega32-16.bootloader.high_fuses=0x89

 Posted by at 11:30
Дек 082012
 

Код для mbed NXP LPC11U24

WIKI: OR-BWSENSE

 

DigitalInOut QTRA(p6); //connected to digital P6
DigitalInOut QTRB(p5); //connected to digital P5

DigitalOut led1(LED1);
DigitalOut led4(LED4);

Timer t;

Serial pc(USBTX, USBRX); // tx, rx

int bw=0,aw=0,k;

int main()
{

while(1) {

QTRA.output();
QTRA.mode(PullUp);
wait_us(2500);
QTRA.mode(PullNone);
QTRA = 1;
t.start();
QTRA.input();
while (QTRA == 1 || t.read_us() < 3000);
bw = t.read_us();
t.stop();
t.reset();

QTRB.output();
QTRB.mode(PullUp);
wait_us(2500);
QTRB.mode(PullNone);
QTRB = 1;
t.start();
QTRB.input();
while (QTRB == 1 || t.read_us() < 3000); aw = t.read_us(); t.stop(); t.reset(); // pc.printf(«%d %d\n»,bw,aw); if (bw > 3100) { led1 = 1; } else { led1=0; } // Black
if (aw > 3100) { led4 = 1; } else { led4=0; } // Black

}
}