'------------------------------------------------------------------------------- ' starter.bas ' this is an example for speaking phrases from a ' preprogramed Devantech Speech Synthesizer ' what phrase is speaking will be shown on com2 '------------------------------------------------------------------------------- $crystal = 14745600 $regfile = "m128def.dat" $baud1 = 19200 '$sim 'config serial buffer Config Serialout1 = Buffered , Size = 40 Config Serialin1 = Buffered , Size = 40 'com 2 standard conection Config Com2 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 'config I2C lines for mavric Config Sda = Portd.1 Config Scl = Portd.0 'this sub writes data to the Devantech Speech Synthesizer 'Declare Subs Declare Sub I2cwrite8_b(byval I2cnode As Byte , Byval Loc As Byte , Byval Value As Byte) ' Startup int code I2cinit 'start the I2C buss Open "com2:" For Random As #2 'open come port Enable Interrupts 'enable interupts 'varables Dim Count As Byte 'varable for counting Const Speak = 196 'make address of Devantech Speech Synthesizer 'start main program Do For Count = 1 To 30 Wait 2 '2 second between phrases Call I2cwrite8_b(speak , 0 , Count) 'command to start speaking phrase Print #2 , "speaking phrase " + Str(count) + Chr(13) Next Count Loop 'end main program 'subs '------------------------------ I2C I2C I2C I2C I2C I2C I2C I2C I2C I2C I2C Sub I2cwrite8_b(byval I2cnode As Byte , Loc As Byte , Value As Byte) I2cstart I2cwbyte I2cnode I2cwbyte Loc I2cwbyte Value I2cstop Waitms 10 End Sub '-----------------------------------------------------------------------------