Thanks, __CONFIG line was indented:-
In one test I copied the example from the 16F876A.INFO file and only changed XT to HS.
I have even removed the the #CONFIG/#ENDCONFIG completely and set the config bits via the programmer.
Have tried a bunch of variations around the config bits down to having everything Off except OSC=HS (8MHz crystal)
The software functions perfectly except for the corrupted Serout in all cases above.
The software reads a data pulse train and timing is critical.
There is a 3 digit LED display on the unit and that displays correctly...only Serout (or Serout2) does not work.
My logic probe confirms that data is being sent but no variation of setup (baud, bits, stops, parity) in the PC will result in a display other that gobbledygook.
BTW, my ASCII output is on RB5 and that pin feeds into a FTDI FT232R.
So, methinks my issue is either:-
Config (but I have tried heaps of variations there) or,
a corrupted modedefs.bas (but I have tried Serout USBport,2,etc and I have tried Serout2) or,
it is MCSP/PBP3/MPASM3 not being happy with the 16F876A (have tried two sets of hardware) or,
some issue between MCSP/PBP3/MPASM themselves (have tried these loaded on Windows 7 and on XP).
I did develop a little timing control unit (for variable wipers) using PBP3 and had Serout setup to help with development.
The unit took input from the speed of the vehicle to vary the wipe timing and used Serout to get the speedo pulse rate vs speed.
This was on a 16F88 and Serout worked just fine.... which why I am suspecting some issue between MCSP/PBP3/MPASM and the 16F876A ?
I have not tried starting a new .PBP file and typing up the basic program needed to just get an ASCII output.
I can also reload the older version of PBP (have the disks) onto the XP machine and see how that goes.
BTW, I created this unit design over 5 years ago and they have performed without issue until recently when one site was not displaying data correctly.
Tracked that down to a noise on the input signal (unique to the site) so I added some filtering to the input circuit... problem solved.
I can leave it running with the old .HEX file for now.. changing the header is just a nicety.
My issue is that, if in the future I do have an issue that needs to be fixed in software, this Serout issue is going to be a big problem... would rather find a solution sooner rather than later.
Appreciate the queries raised so far... please keep going... there must be something ....




Bookmarks