1 # create a new node 'n'
4 # load the gpsim modules library. For some reason I can't just load it from /usr/lib
5 # so to get this working, I had to issue a 'ln -s /usr/lib/libgpsim_modules.so.0 /tmp/libgpsim_modules.so'
6 module lib /usr/lib/libgpsim_modules.so.0
8 # create an USART called 'U1'
11 # attach both the TX bit of the PIC 'portb2' (RB2) and the RX pin of the U1 USART
12 # to the node n. This means: connect them together
13 attach n pin(portb2) U1.RXPIN
15 # make the console from the U1 USART do something. In our case, it will display the characters submitted by the PIC
18 #this is actually 2400, but we're using a
19 #SPBRG for a 4MHz clock instead of 20MHz
22 # tell the builtin scope in gpsim to monitor portb2
23 # (in gpsim: Windows -> Scope)
26 #this value doesn't matter, as gpsim usart is relative to the frequency