~~META: status = done &relation firstimage = :project:elbow.jpg ~~
General purpose open-source ARM based MCU peripheral controled via USB.
Allows cheap and easy way to control input/outputs of arm7 based device from host computer via USB.
Price for building such device should not exceed 500 CZK (25 USD).
How to talk to ELBOW:
b00lean@hcooh:~$ echo "PING" > /dev/ttyACM0
How to listen to ELBOW:
b00lean@hcooh:~$ cat /dev/ttyACM0
Interactive mode:
harvie@insomnia ~ $ minicom -D /dev/ttyACM0
Legend:
C = Computer
E = ELBOW
How to check that elbow is alive:
C> PING E> PONG
Get Elbow version:
C> VERSION E> VERSION ELBOW 1.0.2
Get Elbow serial number:
C> GETSERIAL E> SERIAL 12345678
Set Elbow serial number:
C> SETSERIAL 12345678 E> SERIAL 12345678
Read Elbow's current GPIO configuration:
This command returns configuration of every IO pin output (32)
Legend:
O = output I = input F = input with glitch filter P = input with pull-up resistor(10kOhm) A = input with pull-up resistor and glitch filter Letter in uppercase means that pin is permitted. Letter in lowercase means pin is not permitted.
C> CFGIO E> CFGIO FOOOPPPPPPPPPPPPOPfPPPPPPIIioAOP
Configure Elbow's GPIO:
C> CFGIO iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii E> CFGIO OK
Reading all Elbow's inputs:
C> GETIO E> GETIO 10011111111111110111111111111101
Setting all Elbow's outputs to logical 1:
C> SETIO 11111111111111111111111111111111 E> SETIO OK
Setting all Elbow's outputs to logical 0:
C> CLRIO 11111111111111111111111111111111 E> CLRIO OK
Sending pulse on pin 8 of specified duration 100ms(sending oposite state than is current for specified duration):
C> PULSE 8 100 E> PULSE OK
Enable input value change on input pin number 3 reporting and report value after 100 continuous reads.
In example elbow is reporting that on pin 3 level changed to logical 1
C> EIOIRQ 3 100 E> EIOIRQ OK E> IOIRQ 3 1
Disable input value change on input pin number 3 reporting
C> DIOIRQ 3 E> DIOIRQ OK
Get 1-wire chip serial number connected to pin 8 (PA08):
C> GETSERIAL 8 E> SERIAL 000002950dcd if chip is not found: E> SERIAL EMPTY
Get 1-wire chip temperature connected to pin 8 (PA08):
C> GETTEMP 8 E> TEMP 22.6 if chip is not found: E> TEMP EMPTY
How to read 10 bytes from device user reserved RAM(20kB) from offset 0
C> RAMREAD 0 10 E> RAMREAD OK E> datadatadata E> EOF
How to read 10 bytes from device user reserved FLASH(64kB) from offset 0
C> FLASHREAD 0 10 E> FLASHREAD OK E> datadatadata E> EOF
How to write 10 bytes to device user reserved RAM(20kB) to offset 0
C> RAMWRITE 0 10 E> RAMWRITE READY C> datadatadata E> RAMWRITE OK
How to write 10 bytes to device user reserved RAM(64kB) to offset 0
C> FLASHWRITE 0 10 E> FLASHWRITE READY C> datadatadata E> FLASHWRITE OK
How to make sure that if power is lost on pin 4(turns to logical 0) first 256 bytes of RAM will be stored in internal flash memory before the device dies on power loss:
C> ESAFERAM 4 E> ESAFERAM OK
When power loss occurs elbow will try to send message on usb:
E> SAFERAM SAVED
How to restore saved 256 bytes of data from flash to RAM:
C> RSAFERAM E> RSAFERAM OK
1. ADVref44. Vcc 2. AD4 43. Vcc 3. AD5 42. DDP 4. AD6 41. DDM 5. AD7 40. PA31? 6. PA17 39. PA0 7. PA18 38. PA1 8. PA21 37. PA2 9. PA19 36. PA3 10. PA22 35. PA30 11. PA23 34. PA29 12. PA20 33. RESET 13. PA16! 32. PA28 14. PA15 31. PA27 15. PA14 30. PA4 16. PA13 29. PA5 17. PA24 28. PA6 18. PA25 27. PA7 19. PA26 26. PA8 20. PA12 25. PA9* 21. GND 24. PA10* 22. GND 23. PA11! ! - reserved for USB detection * - used also for JTAG ? - used for alive signalization (blinking diode - output)