Skip to content

Instantly share code, notes, and snippets.

View matthijskooijman's full-sized avatar

Matthijs Kooijman matthijskooijman

View GitHub Profile
@matthijskooijman
matthijskooijman / README
Created November 26, 2014 20:58
Long haul testing
These are just ejemplo_1a (TX) and ejemplo_1b (RX), with the receiver's loop modified to actually print packets instead of displaying a confusing message about timeouts. Also, the serial baudrate was changed for debugging.
Wiring is:
MISO/MOSI/SCK to their respective pins on the Arduino
SSN to D2
GND to GND
All three VDD pins to 3V3
No other pins are wired.

Examples

--- a/firmware/bootloader/src/main.c
+++ b/firmware/bootloader/src/main.c
@@ -727,6 +727,7 @@ int main(void)
unsigned char *p = msgBuffer+10;
unsigned int data;
address_t tempAddress;
+ PORTE |= 1;
if ( msgBuffer[0] == CMD_PROGRAM_FLASH_ISP )
{
bootloader.elf: file format elf32-avr
Disassembly of section .text:
0003e000 <__vectors>:
3e000: 99 c0 rjmp .+306 ; 0x3e134 <__ctors_end>
3e002: 00 00 nop
3e004: aa c0 rjmp .+340 ; 0x3e15a <__bad_interrupt>
3e006: 00 00 nop
matthijs@grubby:~$ pinoccio rest GET /v1/sync | grep '"troop":"3".*connection'
{"data":{"account":"1859","troop":"3","type":"connection","value":{"status":"offline"},"time":1421517850805.003}}
^C
matthijs@grubby:~$ pinoccio cmd 3 1 uptime
{"type":"reply","from":1,"id":"87c3995","end":true,"reply":"Total: 0 days, 0 hours, 14 minutes, 52.560656 seconds\r\nAwake: 0 days, 0 hours, 14 minutes, 52.564080 seconds\r\nAsleep: 0 days, 0 hours, 0 minutes, 0.000000 seconds\r\n","_cid":12,"basetime":338,"commandsPending":0,"messagesQueued":0,"account":"1859","tid":"3","_t":1421518714949,"output":"Total: 0 days, 0 hours, 14 minutes, 52.560656 seconds\r\nAwake: 0 days, 0 hours, 14 minutes, 52.564080 seconds\r\nAsleep: 0 days, 0 hours, 0 minutes, 0.000000 seconds\r\n","result":false}
999
DXF generated by OpenJsCad
0
SECTION
2
HEADER
0
ENDSEC
0
SECTION

Praatje Arduino zonder Arduino

  • Wie ben ik? Msc ES UT, FON Wifi firmware, 2,5 jaar bezig met Arduino, 1,5 jaar met Pinoccio.
  • Wat gaan we doen? Introductie over Arduino, wat doet de IDE, hoe kunnen we dat zelf? Samen begin met opdracht, zelfstandig verder. Volgende week nabespreken.
  • Wat is Arduino? Hardware, IDE en API/core.
  • Hardware: Veel soorten, basisidee is simpel: MCU, xtal, power, serial (16u2/ftdi), led, resetknop. Kan op breadboard.
matthijs@grubby:~$ avr-gcc -x c -c foo.cpp
matthijs@grubby:~$ avr-gcc -c foo.cpp
foo.cpp:1:7: error: ‘__flash’ does not name a type
const __flash int array[] = { 3, 5, 7, 11, 13, 17, 19 };
^
matthijs@grubby:~$ cat foo.cpp
const __flash int array[] = { 3, 5, 7, 11, 13, 17, 19 };
@matthijskooijman
matthijskooijman / gist:3dfa6ab414cbbd5d6d16
Created May 2, 2015 18:32
/etc/udev/rules.d/77-local-mm-blacklist.rules
# Prevent ModemManager from probing Arduino boards...
ACTION!="add|change", GOTO="mm_usb_device_blacklist_end"
SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end"
ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_device_blacklist_end"
# NXP devices (mbed)
ATTRS{idVendor}=="0d28", ENV{ID_MM_DEVICE_IGNORE}="1"
# FTDI devices
2d1
< bitmaps 00000028 .text
5a5
> __cxa_pure_virtual 00000002 .text
7,8c7,8
< default_sleep(unsigned int) 00000014 .text
< default_yield() 00000006 .text
---
> default_sleep(unsigned int) 00000016 .text
> default_yield() 00000008 .text