Hello all.
I'm creating a small circuit with an 08m chip to make it act as a USB device.
I have the board connecting to my PC using an 'el cheapo' USB-2-ttl cable - no problems here. Since I need to control the 08m from an application running on the PC and also avoid having the 08m stuck on the serin command I have setup an interrupt on the serin pin. When I need to send a new command to 08m I send chr(8) to trigger an interrupt, wait a few ms and then send the single character command.
This is the command to set the interrupt:
setint %00000000, %00001000
This is the interrupt routine:
The problem that I'm having is that in order for the 08m to receiver and run the command I have to send 0x08 + 0x36 + 0x00 (or any other character) instead of just sending the 'interrupt' character and the command character. Sending only the 'interrupt' character and then the command (0x08 + 0x36) makes the 08m to wait for another character. I can verify this behavior buy using an 'audio feedback' sound command.
At first I thought that it was probably the serial cable but after tapping on the serin pin using the bus pirate device I saw that every character send from the PC application is actually pushed down the serial link to the 08m. Sending the characters with a delay between them doesn't change anything.
It's not a problem anymore since I found a workaround. It's just that I would like to know if it's a bug or not.
I'm using 2 08m with firmware version 9.0
I'm creating a small circuit with an 08m chip to make it act as a USB device.
I have the board connecting to my PC using an 'el cheapo' USB-2-ttl cable - no problems here. Since I need to control the 08m from an application running on the PC and also avoid having the 08m stuck on the serin command I have setup an interrupt on the serin pin. When I need to send a new command to 08m I send chr(8) to trigger an interrupt, wait a few ms and then send the single character command.
This is the command to set the interrupt:
setint %00000000, %00001000
This is the interrupt routine:
Code:
interrupt:
' Set the LEDs off
low DISPLAY
' Store the old CMD
let OLDCMD = CMD
' Get a new command from the PC
' Display the command prompt
serout 1, t2400, ("*?")
' SerIn to get the command
serin 3, t2400, #CMD
' Send audio feedback
sound 2, (110,10)
' Pause before setting the interrupt again
pause 200
' Set the NEWCMDFLAG to 1
let NEWCMDFLAG = 1
' Set the interrupt again
setint %00000000, %00001000
' Return to main loop
return
At first I thought that it was probably the serial cable but after tapping on the serin pin using the bus pirate device I saw that every character send from the PC application is actually pushed down the serial link to the 08m. Sending the characters with a delay between them doesn't change anything.
It's not a problem anymore since I found a workaround. It's just that I would like to know if it's a bug or not.
I'm using 2 08m with firmware version 9.0