i wrote some code to send MIDI data over the soft serial port of a PIC 12F1501
at a 4Mhz clock speed it worked,but only upto 28800 baud;not at MIDI's 31.250 baud.
this chip was chosen as the most basic part in the demo version of the new OshonsoftPIC 16 compiler.
my question is ,what is the maximum baud rate acheivable using the soft UART ?
i tried raising the clock rate to 8Mhz but still no joy. at 16Mhz the compiler threw an error and shut down
Sounds to me as if you are struggling with oscillator configuration.... The compiler spitting it's dummy out at 16Mhz makes it seem as if a parameter has a "divide by zero" error and that will cause a run time error..
my MIDI splurger code, a basic try-out to use soft uart on a modern 8-pin uart-less (cheap!)PIC;as the newer parts are plenty fast enough
i'm unsure as to wether i'm just running too fast for the soft uart;i've tried various clock speeds;20Mhz caused a compiler crash.
still waiting for the definitive answer from Vladimir,maybe i'm running in diving boots! i havn't found away of adjusting the baud rate,
as mentioned in the help file;typing in a slighly altered number simply causes an warning message about using a non-standard number...
code (text):
'MIDI out for 12F1501 11/10/2015
'sends voice,controller,value in MIDI format
'from portA.0 (pin7)
Define CLOCK_FREQUENCY = 4
'clock is 4Mhz; done here also
'so we know it's in the listing!
ConfigPin PORTA.0 = Output
Dim voice As Byte
Dim cntrnr As Byte
Dim vals As Byte
voice = 0x90
cntrnr = 0x3c
vals = 0x7f
Define SEROUT_DELAYUS = 1000
Serout PORTA.0, 31250, voice, cntrnr, vals '31250Khz baud rate
'for soft UART;this chip has no hardware one...
'to-do; end the loop after successful transmission.