PDA

View Full Version : Serout2 pic18f2620



cerio
- 23rd May 2007, 15:40
The ask help, The don'ts know very the English. Use MPLAB IDE v7.50 PBP2.46
__CONFIG _CONFIG1H, _OSC_HS_1H
__CONFIG _CONFIG2L, _BOREN_OFF_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
__CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
Programma:…
Start:
Temp=23
' hserout["123 ",13,10]
TimeOut=1000
serout2 PORTA.0,194,["123 ",dec Temp,10,13]
High RST
Low ON_OFF
Low LEDV
For Temp=0 TO 10
Toggle LEDV
Pause 0500
Next Temp
goto start
end
These macaws the dates seriali: <0>L™3 23
Oppure: serout2 PORTA.0,194,["1234567 ",dec Temp,10,13]
The visualize: <0>L™34567 23
Oppure: serout2 PORTA.0,194,[ dec Temp,10,13]
The visualize: <0>¦&¡C
The led works well. If I use HSEROUT the circuit she works well, but The cannots use him it. Thanks to everybody.

skimask
- 23rd May 2007, 16:42
' hserout["123 ",13,10]

serout2 PORTA.0,194,["123 ",dec Temp,10,13]


I don't think your 'SEROUT2' mode value is set correctly. You have the SEROUT2 command set up for 4,673 baud, driven output, no inversion, no parity.
Check the PBP manual (Section 5.74 and Appendix A) for the correct method to determine the value required for your baud rate.
If you still can't get it work, let us know...

mister_e
- 23rd May 2007, 17:10
PORTA.0 is analog, you MUST disable the multiplexed analog stuff on it.


ADCON1=$0F
CMCON = 7

HSEROUT will work as long you have properly set the related DEFINEs + DEFINE OSC. HSEROUT defaults is 2400Baud @ 4MHz.

http://www.mister-e.org/pages/utilitiespag.html

cerio
- 23rd May 2007, 22:12
For skimask if I use 188 (4800N8) The visualize: < 0 > L. & MM. D. & C
Problem resolved by Mister e.
Code.....

OSCCON=%01100000 '= > set internal osc to 4MHZ
ADCON1=$0F 'PORTA.0 is analog, you MUST disable the multiplexed analog stuff on it.
CMCON = 7..

serout2 PORTA.0,188, ["1234567 ", dec Temp,10,13]
I correctly visualize: 1234567 23
Thanks of heart for the help

skimask
- 23rd May 2007, 23:06
For skimask if I use 188 (4800N8) The visualize: < 0 > L. & MM. D. & C

serout2 PORTA.0,188, ["1234567 ", dec Temp,10,13]
I correctly visualize: 1234567 23
Thanks of heart for the help

I mentioned that because you had 194 as your mode in the SerOut2 in post #1, which would indicate to me that your oscillator is running fast. You might want to tweak your OSCTUN, if your PIC is so equipped (but we don't know that since you didn't include that info).