Окт 272014
 

Library for Arduino 1.0.3
LCD_Library

Library for Arduino 1.05

При инициализации экрана необходимы вот эти строчки.

lcd.init(EPSON);
lcd.contrast(44); 

ColorLCDShield-master

Color LCD Shield (SparkFun)

Color LCD Shield (SparkFun)

Описание

ColorLCDShield

Для AtMega 1284p


*.h
#else
	
	#define LCD_PIN_RES			2 // 26		// D8
	#define LCD_PIN_CS			3 // 27		// D9
	#define LCD_PIN_DIO			5		// D11
	#define LCD_PIN_SCK			7		// D13


	#define	LCD_PORT_CS		PORTA
	#define	LCD_PORT_SCK		PORTB
	#define	LCD_PORT_RES		PORTA
	#define	LCD_PORT_DIO		PORTB
#endif

И вот это в *.cpp

DDRB = ((1<<LCD_PIN_DIO)|(1<<LCD_PIN_SCK));  
DDRA = ((1<<LCD_PIN_CS)|(1<<LCD_PIN_RES));

 Posted by at 16:38
Окт 232014
 

Разводка платы для проектов: ATMEGA1284P

Как превратить ATmega1284P в Arduino проверенно работает.

SanguinoPinBindings

 

Прошивка для Atmega 1284P.

Программирование через Arduino ISP


Programming Uno     Target board (1284P)

D10 (SS)            Reset - pin 9 (green)
D11 (MOSI)          Pin 6 (yellow)
D12 (MISO)          Pin 7 (orange)
D13 (SCK)           Pin 8 (black)

Gnd                 Gnd (blue)
+5V                 +5V (red)

IMG_1221

 Posted by at 11:41
Июн 242014
 

Простое чтение данных.

#!/usr/bin/perl
    use GPS::NMEA;
    use Data::Dumper;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        $gps->parse;
    
        # Dump internal NMEA data:
        $gps->nmea_data_dump;
    
        # Alternative to look at the internal NMEA data:
        require Data::Dumper;
        print Data::Dumper->new([$gps->{NMEADATA}],[])->Indent(1)->Useqq(1)->Dump;
    }

Печатаем координаты.


 #!/usr/bin/perl
    use GPS::NMEA;
    use Data::Dumper;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        $gps->parse;
    
        # Dump internal NMEA data:
        $gps->nmea_data_dump;
    
        # Alternative to look at the internal NMEA data:
        require Data::Dumper;
        print Data::Dumper->new([$gps->{NMEADATA}],[])->Indent(1)->Useqq(1)->Dump;
    }

Дамп всех NMEA данных с порта.

 #!/usr/bin/perl
    use GPS::NMEA;
    use Data::Dumper;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        $gps->parse;
    
        # Dump internal NMEA data:
        $gps->nmea_data_dump;
    
        # Alternative to look at the internal NMEA data:
        require Data::Dumper;
        print Data::Dumper->new([$gps->{NMEADATA}],[])->Indent(1)->Useqq(1)->Dump;
    }
 Posted by at 17:22
Июн 192014
 

Cubieboard / Cubietruck Debian Wheezy SD card image

Fex Guide — Описание FEX стандарта

Cubieboard1&2_HW.pdf

/boot/cb2-hdmi.bin
# bin2fex cb2-hdmi.bin > cb2-hdmi.txt
# fex2bin cb2-hdmi.txt cb2-hdmi.bin

PH20 — Зеленый светодиод на плате.

Все порта должны быть прописаны а также не должны пересекаться.

[gpio_para]
gpio_used = 1
gpio_num = 3
gpio_pin_1 = port:PH20<1><default><default><1>
gpio_pin_2 = port:PH21<1><default><default><1>
gpio_pin_3 = port:PD1<1><default><default><1>

#cd /sys/class/gpio
#ls -al
 export
 gpiochip1 -> ../../devices/platform/gpio-sunxi/gpio/gpiochip1
 unexport

Активация порта PH20. (echo 3 -> для PD1)
# echo 1 > /sys/class/gpio/export 
# ls -al
 export
 gpio1_ph20 -> ../../devices/platform/gpio-sunxi/gpio/gpio1_ph20
 gpiochip1 -> ../../devices/platform/gpio-sunxi/gpio/gpiochip1
 unexport

Включаем режим вывода.
# echo out > gpio1_ph20/direction 

Читаем из порта.
# cat gpio1_ph20/value
 0

Записываем в порт.
# echo 1 > gpio1_ph20/value
# cat gpio1_ph20/value
 1


Проверенно, работает.

http://blog.radiotech.kz/blog/cubieboard/34.html

gpio_defination_large

 Posted by at 15:16
Июн 032014
 

Cubieboard / Cubietruck Debian Wheezy SD card image.

  • Debian Wheezy 7.5 based
  • Kernel 3.4.91 with broad hardware support, headers included
  • Ethernet adapter with DHCP and SSH server ready on default port (22) with regenerated keys @ first boot
  • Wireless adapter with DHCP ready but disabled (/etc/network/interfaces, WPA2: normal connect or AP mode)
  • Enabled audio devices: analog, spdif and I2S
  • Advanced IR driver with RAW RX and TX
  • Bluetooth ready (currently working only with supported external USB devices)
  • Clustering / stacking
  • USB redirector — for sharing USB over TCP/IP (disabled by default /etc/init.d/rc.usbsrvd)
  • root file-system auto resize
  • Graphics desktop environment upgrade ready
  • NAND and SATA install script included (/root)
  • Disabled LED blinking, logo, boot messages (/etc/init.d/disable_led.sh, kernel.config, kernel parameters in uEnv.txt)
  • Total memory is exactly 2000Mb (disabled all memory reservations for GPU)
  • Login script shows Cubietruck / Cubieboard 2 auto MOTD with current CPU temp, hard drive temp & actual free memory
  • MAC address from chip ID, manual optional
  • Fastest Debian mirror auto selection @ first boot
  • root password=1234
  • sunxi-tools included: fex2bin, bin2fex, nand-part
  • Performance tweaks:
    • /tmp & /log = RAM, ramlog app saves logs to disk daily and on shut-down
    • IO scheduler NOOP for SD, CFQ for sda (mechanical hard drive). (change in /etc/sysfs.conf)
    • journal data writeback enabled. (/etc/fstab)
    • commit=600 to flush data to the disk every 10 minutes (/etc/fstab)
    • optimized CPU frequency scaling 480-1200Mhz with interactive governor and small 20% overclock (/etc/init.d/cpufrequtils)
  • Known bugs or limitations
    • On board Bluetooth unstable / unusable (firmware issue)
    • NAND install script sometime fails. Dirty but working workaround — installing Lubuntu to NAND with Phoenix tools and run the nand-install again.
    • Gigabit ethernet transfer rate is around 50% of its theoretical max rate (hardware or firmware issue)
    • Shutdown, reboot and battery troubles regarding poor AXP chip driver (firmware issue, probably solved in development kernel)
  • Unzipped images can be written with Image Writer on Windows or with DD command in Linux/Mac (dd bs=1M if=filename.raw of=sd card device). Kernel package should be uncompressed under root user to / Change boot parameter if your old kernel has different name.
 Posted by at 11:51