Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
18F4620 [abandoned]
#10
(2011-02-28, 22:10:23)Mikael Gustafsson Wrote: How do you set up the uart on your working application?

I am using a MAX 232 Chip on my RS232 PCB and I have connected the TX pin to TX Pin 25 on the Pic (RC6) and the RX pin to Pin 26 (RC7).

Device = 18F4620
Xtal = 20
Bootloader=On
All_Digital=TRUE
Optimiser_Level=3 '
Dead_Code_Remove=On '
Keypad_Port=PORTB
PortB_Pullups = On
Stack_Size=40 '
Declare Hbus_Bitrate 400
Declare Float_Display_Type = fast '
Warnings=off
Reminders=off
Declare serial_data 8 ' Set Serin & Serout data Bits to 8
RCSTA.7 = 1

-------------------------------------------------------------------------------
Hserial_Baud = 19200 ' SET BAUD RATE TO 9600
Hserial_RCSTA = %10010000 ' ENABLE SERIAL PORT AND CONTINUOUS RECEIVE
Hserial_TXSTA = %00100100 ' ENABLE TRANSMIT AND ASYNCHRONOUS MODE
Hserial_Clear = On ' ENABLE ERROR CLEARING ON RECEIVED CHARACTERS
'-------------------------------------------------------------------------------
ADCON0 = %00001111 ' RA3 Pins set for 12vdc Battery Monitoring *****16F887**** ADCON0 = %01001101
ADCON1 = %00001101 ' ADC Setup for Battery Level Monitoring *****16F887**** ADCON1 = %11001111
ADCON2 = %10101101
Adin_Stime = 50 ' Allow 50us sample time for the ADC
'--------------------------------------------------------------------------------
TRISA=%00011100 ' Pin RA4 is the Input for the Door Switch
TRISB=%00000000
TRISC=%11000001 ' Pin C
TRISD=%00000000
TRISE=%00000000
PORTA=0
PORTB=0
PORTC=0
PORTD=0
PORTE=0

Thanks
Craig
Reply


Messages In This Thread
18F4620 [abandoned] - by craig - 2011-02-22, 14:42:16
RE: 18F4620 - by craig - 2011-02-23, 15:21:22
RE: 18F4620 - by Mikael Gustavsson - 2011-02-23, 20:31:16
RE: 18F4620 - by craig - 2011-02-24, 10:28:42
RE: 18F4620 - by Mikael Gustavsson - 2011-02-24, 20:45:44
RE: 18F4620 - by craig - 2011-02-24, 21:59:34
RE: 18F4620 - by Mikael Gustavsson - 2011-02-24, 22:21:24
RE: 18F4620 - by craig - 2011-02-25, 18:21:40
RE: 18F4620 - by Mikael Gustavsson - 2011-02-28, 22:10:23
RE: 18F4620 - by craig - 2011-03-01, 08:43:17
RE: 18F4620 - by Mikael Gustavsson - 2011-03-03, 22:38:13
RE: 18F4620 - by craig - 2011-03-04, 09:44:06
RE: 18F4620 - by Mikael Gustavsson - 2011-03-04, 20:15:37
RE: 18F4620 - by kvrbek - 2011-03-06, 19:32:24

Forum Jump:


Users browsing this thread: 2 Guest(s)