One circuit example is already in the HELP TOPIC under ICD>Introduction>>Harware Setup. By the way i attach one example.
With MicroCode studio you'll be able to send and receive to your PIC in the same windows task.
I think from what I read so far its not possible to connect the the PIC to the MAX then to the port directly due to some inverting thing which I really dont understand.
You can connect PIC directly to the PC without MAX232 if you're using SERIN/SEROUT and if you're using Inverted Mode. But if You're using the internal USART... you cannot set it by software. Hardware only, this is why you need an MAX232 or some simples inverter transistor circuit.
I wonder if anyone could give me some working code to echo data sent from the pc back from the PIC so I can be sure to get started.
The following will give you this @9600 baud.
Code:
' Serial data echo test
' =====================
'
' File name : Serial_echo_test.bas
' Company : Mister E
' Programmer : Steve Monfette
' Date : 16/01/2005
' Device : PIC16F877
' PIC setting & Programming mode
' -------------------------------
'
@ __config _HS_OSC & _WDT_ON & _PWRTE_ON & _BODEN_ON & _LVP_OFF
' HS(20Mhz) oscillator
' Enable watch dog timer
' Enable power up timer
' Enable brown out detect
' Disable low voltage programming
DEFINE OSC 20 ' Use 20 MHZ oscillator
' Usart Settings
' --------------
'
' refer to datasheet section 10 for the following settings
'
DEFINE HSER_RCSTA 90h ' Enable Serial PORT
' Enable continuous receive
'
DEFINE HSER_TXSTA 24h ' Enable transmit
' High baud rate (BRGH=1)
'
DEFINE HSER_SPBRG 129 ' set USART to 9600 baud (when BRGH=1)
DEFINE HSER_CLROERR 1 ' Enable automatic overrun error
' Variable Definition
' -------------------
SerData var byte
Start:
' Program begining/Main Loop
' ==========================
'
HSERIN [serdata]
hserout [serdata]
goto start
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks