PDA

View Full Version : Serout2 Issues 18f258 Vs. 18f2585



samam
- 29th June 2006, 00:03
I'm having trouble using the SEROUT2 command with some of the newer PIC parts. I've compiled and programmed the following code onto both the 18F258 and the 18F2585. Everything works as expected for the 18F258 but the SEROUT2 command doesn't seem to do anything for the 18F2585. Probing with an oscilloscope shows no activity at the pin. I've had similar problems using the SEROUT2 command with other newer parts including the 18F2525,18F2550.

DEFINE OSC 20

DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_BAUD 19200

TRISC = %10000000

LED0 VAR PORTC.4
LED1 VAR PORTC.5

LED0 = 0
LED1 = 0

LOOP:

HSEROUT [254,84,254,88]
SEROUT2 PORTC.0,32,[254,84,254,88]
LED0 = 1
LED1 = 0
PAUSE 500

HSEROUT [254,72,"HARDWARE SERIAL OUT"]
SEROUT2 PORTC.0,32,[254,72,"SOFTWARE SERIAL OUT"]
LED0 = 0
LED1 = 1
PAUSE 500

GOTO LOOP

END

mister_e
- 29th June 2006, 01:09
look at the table bellow.. it's all black on white
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=944&stc=1&d=1151536157">

unless you have modified the T1CON register badly somewhere, my guess will be


Serout LATC.0,32,plahplahplah

samam
- 29th June 2006, 14:51
I think I figured it out. After playing around with all the available configuration bits it appears that you must disable the extended cpu option. Some programmers dont give you the option to change all the configuration bits after compiling so it can be difficult to make these changes unless you know how to modify the appropriate *.ini file.