Change TXSTA to ...9600 baud at 4Mhz needs the BRGH bit set to 1 with SPBRG = 25.Code:DEFINE HSER_TXSTA 24h
Change TXSTA to ...9600 baud at 4Mhz needs the BRGH bit set to 1 with SPBRG = 25.Code:DEFINE HSER_TXSTA 24h
DT
I did the change on “DEFINE HSER_TXSTA from 20H to 25H and tested with same error. I restored all the DEFINES back to its original values (DEFINE OSC 20, DEFINE HSER_TXSTA 20H, DEFINE HSER_SPBRG 32) and used this time a 628-20 Mhz chip. I got the same error “Cleaning Display Buffer”. Any suggestion?
Maybe it was just a typo, but TXSTA should have been changed to 24h, not 25h. But it probably wouldn't matter.
And when you say "and used this time a 628-20 Mhz chip"...
Do you mean that you used a 16F628 with a 20Mhz crystal and two 15-33pf capacitors?
DT
Tim,
are you sending data to the screen to see if the message will clear out?
I always see the clearing display message at start, but everything works fine when I send data (without my silly Disabled Interrupt trial..of course).
Yes, was a typo I mean 24h. Yes, I used a 16F628-20 Mhz. I changed the crystal but not the caps, sorry. Mr. Flipper_ND, when I received the error I thought I shouldn’t go on, but I think that you got a point there, I’ll. First I’ll do the test with the two 15-33 pf caps in place and next test sending some data. I’ll report to both of you. Thanks.
Let me report to both of you: I changed the caps and same error. I send the serial data and received it but unreadable and there is no clear screen neither. The program I am using reads as:
PAUSE 1000
SEROUT PORTB.1, 4, [254, 1] ‘Clear the screen
SEROUT PORTB.1, 4, [“ABCDE”]
END
I don’t know why but the PBP 2.50A compiler doesn’t accept
SEROUT PORTB.1, N2400, [254, 1]. (Bad Expression) doesn’t like the N2400. I don’t know if there is a distinction between the N2400 and the 4 alone.
I have spent hours investigating the hardware and the software for any error but find nothing bad. There may be a test program to check the backpack program.
BTW, To be able to write and compile this four lines “text sending serial program” I had to restore the 16F628 .INC file back to it’s original text. (Take the (;) out).
Any ideas of what may I doing wrong? Thanks.
The standard USART requires "TRUE" levels.
N2400 is "Inverted".
Use mode 0 (T2400).
And to use the N2400, T2400 T9600 etc.
Code:INCLUDE "modedefs.bas"
DT
Bookmarks