Once you enable the USART, like the Bootloader do, you can't use RX/TX pin with serout. Use HSEROUT instead... OR get rid of all DEFINES, and disable SPEN bit....
Your program shouldn't finish like that... use STOP of do a loop.
Once you enable the USART, like the Bootloader do, you can't use RX/TX pin with serout. Use HSEROUT instead... OR get rid of all DEFINES, and disable SPEN bit....
Your program shouldn't finish like that... use STOP of do a loop.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi ive used HSEROUT in my code but dont work, im new at this for other person my be very simple but not for
Please can you explain me in a beginer mode?
Is how i used the HSEROUT
Code:
DEFINE LOADER_USED 1
@ device hs_osc
define osc 20
Include "modedefs.bas" ' Include serial modes
DEFINE HSER_BAUD 9600 'Hser baud rate
DEFINE HSER_SPBRG 129 'Hser spbrg init
DEFINE HSER_RCSTA 90h 'Hser receive status init
DEFINE HSER_TXSTA 24h 'Hser transmit status init
DEFINE HSER_CLROERR 1
TrisB.5=0
TrisC.6=0
TrisC.7=1
B0 var byte
High portb.5
Pause 500
Low portb.5
Pause 500
High portb.5
Pause 500
Low portb.5
Pause 500
serout2 portc.6, 32, ["AT", 13]
serout2 portc.6, 84, ["AT+CMGF=1", 13]
serout2 portc.6, 84, ["AT+CSCA=+351xxxxx000", 13]
serout2 portc.6, 84, ["AT+CSCA=+3xxxxxxxxx0", 13]
serout2 portc.6, 84, ["ola", 13]
end
Thanks,
By By
Code:DEFINE LOADER_USED 1 define OSC 20 ' Check the spelling of OSC, must be in capital letter Include "modedefs.bas" ' Include serial modes DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1 DEFINE HSER_SPBRG 129 ' 9600 Baud @ 20MHz, 0.16% DEFINE HSER_CLROERR 1 ' Clear overflow automatically TrisB.5=0 TrisC.6=0 TrisC.7=1 B0 var byte High portb.5 Pause 500 Low portb.5 Pause 500 High portb.5 Pause 500 Low portb.5 Pause 500 HSEROUT ["AT", 13] HSEROUT ["AT+CMGF=1", 13] HSEROUT ["AT+CSCA=+351xxxxx000", 13] HSEROUT ["AT+CSCA=+3xxxxxxxxx0", 13] HSEROUT ["ola", 13] STOP end
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Steve it works very well, thanks a lot for the patience to teach a beginer like me.I will learn this one more lesson.
Sory abouht the box of the code next time i will put it there.
p.s. If you need same thing from Portugal let me now.
By BY
Bookmarks