I am using MCU ATMEGA32A and i am doing serial communication of MCU with PC using Python(importing Pyserial module).
I can give Commands to MCU via serial port using Python but I have to reset MCU after each command. I want MCU should accept multiple commands (second after executing first command and so on)
When I tried same using Hyperterminal then it was accepting multiple commands and executing the same.
I have tried following commands in python:
import serial, time
ser = serial.Serial()
ser.baudrate = 9600
ser.bytesize = serial.EIGHTBITS #number of bits per bytes
ser.parity = serial.PARITY_NONE #set parity check: no parity
ser.stopbits = serial.STOPBITS_ONE #number of stop bits
#ser.timeout = None #block read
ser.timeout = 1 #non-block read
#ser.timeout = 2 #timeout block read
ser.xonxoff = False #disable software flow control
ser.rtscts = False #disable hardware (RTS/CTS) flow control
ser.dsrdtr = False #disable hardware (DSR/DTR) flow control
ser.writeTimeout = 2 #timeout for write
ser.flushInput() #flush input buffer, discarding all its contents
ser.flushOutput()#flush output buffer, aborting current output
It works fine but Now if i tri second command like ser.write ("USB OFF") then it does not work ....