|
|
View previous topic :: View next topic |
Author |
Message |
ThomasC
Joined: 09 Oct 2007 Posts: 62
|
Watch Window shows '.' for Array values; should be 0. SOLVED |
Posted: Tue Feb 12, 2008 5:18 pm |
|
|
MPLAB IDE / PCM 4.060 / ICD2 / PIC16F690-ICD / TELEBYTE 245
Here is an image of the screen. Get485[8] is the array I'm having trouble with. I set it to 0 in this case, and other values previously. It will only show '.' or garbage characters such as 'd', '@'. It was working fine 2 days ago.
Here is the screenshot of the problem:
Array201 works perfect! It will change and show the correct value in the Watch Window.
I've been at it for about 1.5 days and am frustrated. Thanks A lot!
Last edited by ThomasC on Wed Feb 13, 2008 1:11 pm; edited 1 time in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 12, 2008 5:50 pm |
|
|
If you want us to look at it, you need to post a test program.
For example, in this thread I've post a little test program to show
how to step through source code in MPLAB.
http://www.ccsinfo.com/forum/viewtopic.php?t=33505
If you can post a short little program like that, and demonstrate
the problem, then I can test it. |
|
|
ThomasC
Joined: 09 Oct 2007 Posts: 62
|
|
Posted: Wed Feb 13, 2008 9:16 am |
|
|
Here is the test program:
Code: | #include <16F690.h> //Include PIC16F690 header file
#device adc=10 //Configures the read_adc return size. 10 will return the full A/D reading of 10 bits.
#include <STDLIB.h> //Include general purpose standard library
#include <stdio.h> //Include standard input/output header
#include <stdlibm.h>
#include <string.h>
#fuses INTRC,NOWDT,NOPROTECT,BROWNOUT,NOMCLR,BROWNOUT,NOIESO,NOFCMEN,PUT
#use delay(clock=2MHZ,int)
#use rs232(baud=9600, xmit=PIN_B7, rcv=PIN_B5, enable=PIN_C1, ERRORS, stream = Network) //Set Slave address here. //Initializing the hardware UART, the PIC refers to it as EUSART, TX=xmit=PIN_B7, RX=rcv=PIN_B5, Enable Pin=direction control,FORCE_SW
//The enable pin C1 controls the direction of data transfer. It is needed for RS485 Two-Wire.
#rom 0x2100 = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}//0x2100 is for 16F-series PICs
char Array201[27] = {0x01,0x64,0x16,0x00,0x00,0x44,0x26,0x49,0x00,0x00,0x01,0x20,0x41,0x41,0x04,0x2E,0x00,0x01,0x20,0x20,0x20,0x00,0x02,0x01,0x17,0x00,0x1A}; //Response - Identify Sub Array - Opcode 201 - C9(h)
char GetIn485[8]={1,2,3,4,5,6,7,8};
void Network_fputc(char c) //Code from PCM Programmer
{
fputc(c, Network);
}
void main()
{
while(1)
{
delay_ms(80);
printf(Network_fputc, " Hello World! "); //Code from PCM Programmer
}
} |
The values show correctly in the hex and dec columns, if I enable them in the watch window according to the advice I received from the microchip forum: (pardon my run-on)
http://forum.microchip.com/tm.aspx?m=315144&mpage=1&key=񌾋
Here is a screen shot of the result:
Should I just rely on the values in the hex and dec columns? That is fine with me, if necessary. |
|
|
orangeshasta
Joined: 13 Feb 2008 Posts: 7
|
|
Posted: Wed Feb 13, 2008 12:02 pm |
|
|
I'd say it looks like your problem is that the data type for the array is
probably set to "ASCII." Right-click on the array and go to properties -
then select whichever type you're expecting from the "Format" pulldown
(in the "Watch Properties" tab).
-Bob |
|
|
ThomasC
Joined: 09 Oct 2007 Posts: 62
|
|
Posted: Wed Feb 13, 2008 1:10 pm |
|
|
That's it! Sorry that was my blunder.
SOLVED!!!!! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|