Hello,
excuse the delay in replying but it is a week that I'm working and I'm having trouble with the 18F4685.
Since I use the internal oscillator can not figure out if the problem is the CONFIG or the pullup circuit that does not work.
I am using the file IntOsc.BAS:
Code: Select all
#if _Device in (18F4685)
Config
OSC = IRCIO67,
PWRT = On,
WDT = On,
MCLRE = off,
LVP = OFF,
CP0 = OFF,
PBADEN = OFF,
STVREN = off,
BOREN = off
#endif
Include "SetDigitalIO.bas"
SetAllDigital()
#if _device in (18F4685)
OSCCON = %01110000 ' 8MHZ
// OSCCON = %01100000 ' 4MHZ
OSCTUNE = %01000000 ' PLL = fOSC x 4 - 32MHz
#endif
.. and in the module CAN_Echo.BAS of Florin Andrei Medrea I set as follows:
Code: Select all
Device = 18F4685 '18F458
Clock = 32 '40
Include "intosc.bas"
Include "CAN_lib"
Include "usart"
Include "SYS_lib"
Dim Can_Init_Flags,
Can_Send_Flags,
Can_Rcv_Flags,
Rx_Data_Len,
i As Byte,
RxTx_Data(8) As Byte,
Tx_ID,
Rx_ID As LongWord,
Msg_Rcvd,
Msg_Sent As Boolean
ADCON1 = %11000110 // AD off
CMCON = $07 // Comparator off
WDTCON = 1
ClrWDT
' OSCTUNE = %01000000 // 16x4
SetBaudrate(br115200)
DelayMS(1000)
Write("Hello World!",13,10)
After displaying the message "Hello world!" nothing more happens and my doubt is the WDT = On for which there is no WDTPS value.
I saw that the 18F4685 is among the MPU that Florin Andrei expected but I missing some configuration for this particular MPU.
HELP!
PS: I'm waiting for the MCP2551 CAN Transceiver .. so I can take the test as soon as it arrives.
