CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Watch Window shows '.' for Array values; should be 0. SOLVED

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ThomasC



Joined: 09 Oct 2007
Posts: 62

View user's profile Send private message

Watch Window shows '.' for Array values; should be 0. SOLVED
PostPosted: Tue Feb 12, 2008 5:18 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 12, 2008 5:50 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 13, 2008 9:16 am     Reply with quote

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=&#315275

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

View user's profile Send private message

PostPosted: Wed Feb 13, 2008 12:02 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 13, 2008 1:10 pm     Reply with quote

That's it! Sorry that was my blunder.

SOLVED!!!!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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