Advertisement
Guest User

Untitled

a guest
Dec 28th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. # pnvm-arduino
  2.  
  3. ## Description
  4. Here is PNVM simulator for Arduino.
  5.  
  6. This was only tested on Arduino Mega 2560.
  7. For upload it needs at least 64KB flash.
  8. For run at least 8KB SRAM.
  9. - From it at least 2KB must be available just for stack.
  10. - The rest can be devoured by objet memory and net template code.
  11.  
  12. This is not a generic, all-featured, "rule them all" module.
  13. It serves rather as a springboard for other more advanced and more
  14. specific implementations. It just allows to control LED diodes, handle
  15. input from serial line and echo back results -- hardware serial line
  16. (the one for interfacing with PC over USB).
  17.  
  18. It uses LED diods connected to pins:
  19. 3, 4, 5, 6, 7 - for blinking with associated *ledControl*
  20. net instances
  21. 8 - signal processing of input from serial line
  22. - this is handled asynchronously,
  23. each accepted charecter results in change of state
  24. of LED
  25. 9 - signal processing of the main loop
  26. - each step of simulater toggles LED state
  27. 12 - error LED - when this is lit up, board entered never ending
  28. loop as a result of fatal error
  29.  
  30. HIGH state of pin lights up a LED --> connect it like this:
  31. pin -----+
  32. + |
  33. |
  34. (O) led
  35. |
  36. [] resistor
  37. |
  38. --- gnd
  39. -
  40.  
  41. ## Compilation and upload
  42. 1. First make sure, that squeak plugin is up to date:
  43. - in parent directory run:
  44. `$ make src`
  45. 2. Choose platform in platforms/ directory to be loaded into
  46. object memory at startup or make a new one and place it
  47. into platforms named as:
  48. `<name>.txt`
  49. This defaults to "platform".
  50. Note, that if you choose different platform since the previous build,
  51. you need to manually clean the working directory:
  52. `$ make clean`
  53. Before the next step.
  54.  
  55. TODO - make it smarter, requiring little or no explanation on how
  56. to use or build different binaries for different platforms
  57. 3. Compile it:
  58. `$ PLATFORM=<name> make`
  59. 4. Upload it:
  60. - check your device and if it's not /dev/ttyACM0, export it as:
  61. `$ SERIALDEV=/dev/mytty make upload`
  62. - otherwise just run:
  63. `$ make upload`
  64. Note: check, that any program using this device is terminated before
  65. uploading.
  66.  
  67. ## Interfacing
  68. 1. In one terminal run:
  69. `$ examples/listen` # this will echo any output from simulator
  70. 2. In another one:
  71. `$ cat >/dev/mytty`
  72. "input as serialized tokens expected by platform"
  73. "as many as you want until you press ^D"
  74. `^D`
  75. Or:
  76. `$ echo '"same token as in previous example"' > /dev/mytty`
  77. 3. If you run default platform, you may load *ledControl* net template
  78. as a toy for playing with LEDS like this:
  79. `$ examples/led_control`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement