Albert H wrote: ↑Tue Mar 14, 2023 12:42 pm
Looking at the '628 code, it's remarkably similar to that written for Broadcast Warehouse (though there's only so many ways of writing the code!).
Have you tried adding an extra NOP to the main program loop, to fractionally increase the cycle time?
As I remember, the timing on a couple of the coders I've seen was largely done by huge numbers of NOP steps.
Not quite (and I've never seen the BW code for the old kit RDS coder, not sure how you did, unless you were the author)
The 57kHz is generated by the 628's CCP module in PWM mode, and will not quite be 50:50 duty cycle due to hardware limitation when running with a 4.332MHz clock. The data rate is derived from a timer0 overflow interrupt.
Bug list so far, just from reading the code, and with a quick look, looks like both versions of the 628 code have similar issues.
* The data rate is generated by a timer 0 overflow interrupt intended to be running at 4x the data rate (except that when you calculate the rate, the reset value the counter should take is slightly different from that in the disassembly)
* There is a dodgy interrupt context save/restore (possibly from the old compiler used)
* AF (alternate frequencies) transmitted are indeterminate.
* Wasteful use of memory (also the fault of the compiler).
* Changing the PI code and Program type will likely not work.
* Attempting to send a time update will likely not work (do pirates really need this?)
* Little error checking on supplied data (not a great problem if the intended program is used with it)
* RDS output will stop when the current settings are saved to EEPROM. (a major re-write needed to fix that one, but probably not a problem in normal use)
I think that is most of the bugs that I've found so far.
If someone can run the program and provide a loopback dump (serial output to serial input of a terminal program) of the commands sent (everything bar PS name change and RT, which seem to be ok), it will help in fixing most of the bugs.