View previous topic :: View next topic |
Author |
Message |
s_mack
Joined: 04 Jun 2009 Posts: 107
|
console? |
Posted: Fri Aug 28, 2009 10:21 am |
|
|
I have MPLAB IDE and this CCS as a plugin. So I hit "build all" and it does its thing, so I really only see a CCS window for half a second and that's it.
Is there a simple way of getting a console window so I can test my script logic on screen?
Right now I have to build the files, program the device, take the device to the field and test to see if it works. Since there's no textual output in any of this, I then have to guess why it didn't work and try again. That's been fine up until now, but I have an algorithm that works perfectly in my excel simulation and not at all in the field. I want to see the mathematical calculations as they happen to see what might be going wrong.
I know I can get a generic c+ compiler but because every compiler is different I'd rather do it in ccs.
This program was installed on this computer before I got here and I can't seem to find a console so I wonder if its a plug-in only?
Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
s_mack
Joined: 04 Jun 2009 Posts: 107
|
|
Posted: Fri Aug 28, 2009 11:56 am |
|
|
Thanks.
I couldn't get it to work. It compiled fine and "run" worked... but no output as described in that thread.
Maybe because I'm using pic18 and the tutorial is based on a pic16? I don't know.
I can't imagine why MPLAB doesn't have a basic console type output.
This is proving extraordinarily confusing for something that should be simple. |
|
|
s_mack
Joined: 04 Jun 2009 Posts: 107
|
|
Posted: Fri Aug 28, 2009 12:02 pm |
|
|
nevermind (for now )
Using an example file in the help got me on the right track.
#use rs232(uart1, baud=9600)
instead of
#use rs232(baud=9600, xmit=PIN_B2, rcv=PIN_B1, ERRORS)
from the tutorial. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 28, 2009 12:13 pm |
|
|
The "Uart1" feature of the MPLAB simulator requires that the hardware
UART in the PIC be used for output. It won't work with a software UART.
The pins for the hardware UART vary, depending upon which PIC you are
using. If you specify "UART1" in the #use rs232 statement, CCS
generates code for the hardware UART. (Or, for the first hardware UART
in a PIC that has two of them).
"Uart1" as a term used by MPLAB is just coincidentally the same term
as used by CCS in their #use rs232() statement. The MPLAB term
refers to a feature of its simulator. The CCS term is a shortcut for
the hardware UART pins, so you don't have to look-up the correct pin
numbers. The compiler does it for you. |
|
|
|