I want generate MIDI data (SYSEX) with logic EasyHDL generator, but I'm not sure how to do, as it is the first time I use this langage. I tried to start with the samples provided in samples dir of Proteus (serial data and QPSK), and I read help related to this langage. But I didn't found how make my "EasyHDL code" to work.
For my first attempt, I tried to output following sysex data :
0xF0,0x7F,0x00,0x06,0x06,0xF7
(6 bytes, starting with $F0 and ended by $F7)
Code: Select all
// MIDI Sysex generator
// Define data to be output
DATA 0xF0,0x7F,0x00
DATA 0x06,0x06,0xF7
DATA REPEAT
// Define the baud rate
FLOAT BAUD=31250
FLOAT BITTIME=1.0/BAUD
// Declare working variables
INT DataOut
INT i,j,d
TIME td
// Top level
OUT = 1
SLEEP FOR 10m
LOOP:
READ DataOut,td
GOSUB OUTDATA
SLEEP FOR td
GOTO LOOP
// Output data
OUTDATA:
FOR i=1 TO LEN(d)
d = DataOut[i]
GOSUB OUTCHAR
NEXT I
RETURN
// Bit Bang a single character
// 1 Start bit, 1 Stop bit and no
// parity are assumed.
OUTCHAR:
// Start bit
OUT = 0
SLEEP FOR BITTIME
// Data bits
FOR j=0 TO 7
OUT = d & (1 << j)
SLEEP FOR BITTIME
NEXT j
// Stop bit
OUT = 1
SLEEP FOR BITTIME
RETURN
Please, does someone can help me to make this to work ?
Any help will be really appreciated.
(I know that some part of the code is not valid, just written to show what I tried)
Kindest regards,
Remy