KnightSch / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 1 forks source link

Setting PORTA Pins does not work with PyMite on Arduino Mega #135

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

Build and run the code:

import avr
avr.ddrA(0xff)
avr.portA(0xff)

This has no effect on PORTA pins

I am using the latest svn checkout on Ubuntu 10.04, Python version
2.6.5, avr-gcc version 4.3.4

Original issue reported on code.google.com by pram...@gmail.com on 8 Sep 2010 at 2:58

GoogleCodeExporter commented 8 years ago
I am unable to recreate the issue you describe.  I just tested using revision 
595 with NO modifications from the repository::

   $ make PLATFORM=arduino_mega
   $ cd src/platform/arduino_mega
   $ make program AVRDUDE_PORT=/dev/tty.usbserial
   $ ../../tools/ipm.py -f pmfeatures.py --serial /dev/tty.usbserial --baud=57600

You will have to substitute the path to your serial device in the last two 
commands.  Here is my ipm session::

   ipm> print "Hell\x6f"
   Hello
   ipm> import avr, sys
   ipm> avr.ddrA(0xff)
   ipm> avr.portA(0)       # Board pins labeled 22-29 all at 0 V
   ipm> avr.portA(0xa5)
   ipm> sys.heap()
   (2622, 7424)

After the last command, the pin voltages are what you'd expect (0xa5 == 
0b10100101):

======= ======= =======
Pin     Label   [Volts]
======= ======= =======
PA0     22      4.8
PA1     23      0
PA2     24      4.8
PA3     25      0
PA4     26      0
PA5     27      4.8
PA6     28      0
PA7     29      4.8
======= ======= =======

Please let me know if you have more information on this issue.

Original comment by dwhall...@gmail.com on 13 Sep 2010 at 10:02

GoogleCodeExporter commented 8 years ago
I could not recreate the issue pramode was having.  I was able to show that the 
sample code given did work.

Original comment by dwhall...@gmail.com on 25 Oct 2010 at 4:53