Hi there,
I have just started to write a comms application using PIC18F1330.
The compiler stop with an error in the USART module at line 69 thus:
"RCInput As TRISC.Booleans(7),"
It looks as if it doed not support the above device!!
Or maybe I am missing something obvious.
Can you help please?
Regards
Francesco
This is my code:
......................................................................
Device = 18F1330
Clock = 4
Include "usart.bas"
#option TXSTA=%10101110
#option RSTA=%10011010
USART.SetBaudrate(br9600)
..................................................................
Usart Module Error when Using PIC18F1330
Moderators: David Barker, Jerry Messina
-
- Posts: 41
- Joined: Thu Feb 26, 2009 6:54 pm
- Location: UK
TRISC ???? the PIC18F1330 does not have a PortC !!!
If I remember (check the datasheet), the PIC18F1330 had the UART at (RA2==TX) and (RA3==RX)
If I remember (check the datasheet), the PIC18F1330 had the UART at (RA2==TX) and (RA3==RX)
Last edited by octal on Thu Jul 28, 2011 10:26 am, edited 1 time in total.
Just checked the USART module, seem it does not take into account the 18F1230 and 18F1330
correction to do:
at Line 65 in the USART module:
replace by this :
this should work!!! (no need to modify initialization code as PinA.3 and pinA2 does not have analog module on them.
correction to do:
at Line 65 in the USART module:
Code: Select all
#if _device in (18F1220, 18F1320)
RCInput As TRISB.Booleans(4),
TXInput As TRISB.Booleans(1)
#else
RCInput As TRISC.Booleans(7),
TXInput As TRISC.Booleans(6)
#endif
Code: Select all
#if _device in (18F1220, 18F1320)
RCInput As TRISB.Booleans(4),
TXInput As TRISB.Booleans(1)
#elseif _device in (18F1230, 18F1330)
RCInput As TRISA.Booleans(3),
TXInput As TRISA.Booleans(2)
#else
RCInput As TRISC.Booleans(7),
TXInput As TRISC.Booleans(6)
#endif
-
- Posts: 41
- Joined: Thu Feb 26, 2009 6:54 pm
- Location: UK