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

Manchester Code Reader
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

Manchester Code Reader
PostPosted: Thu Jan 22, 2009 9:16 am     Reply with quote

I don't know why the compiler couldn't recognize RBIF, RBIE, PORTB, TMR1IF, TMR1, CARRY, TMR1ON and also the asm. I left out anything? Please help guys. Thanks.[/code]

Last edited by viknes1985 on Fri Mar 20, 2009 12:25 pm; edited 1 time in total
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

follow up
PostPosted: Thu Jan 22, 2009 9:17 am     Reply with quote

and the pragma also giving error statement.....
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Jan 22, 2009 10:54 am     Reply with quote

Yes, you have to modify the code according to CCS C syntax for interrupt functions and assembly statements. Also the SFR
definitions must be included. The device editor tool can make an include file automaticly.

Generally this kind of code is implementation dependant and not portable between different compilers. CCS C has built-in
functions for most operations in your code, but it works by direct SFR access as well. As with any port of low-level code,
you should check if anything is understood by CCS C correctly.

Code:
#include "PIC16F887_registers.h"
//...
#int_RB
void reader(void)

               #asm
                  rlf STAC+7,f
                  rlf STAC+6,f
                  rlf STAC+5,f
                  rlf STAC+4,f
                  rlf STAC+3,f
                  rlf STAC+2,f
                  rlf STAC+1,f
                  rlf STAC+0,f
               #endasm   
Guest








Where to get registers.h
PostPosted: Sat Jan 24, 2009 1:15 pm     Reply with quote

Thanks for the reply FvM. By the way, where to get "PIC16F887_registers.h", i think i may need "PIC16F877a_registers.h" instead. Is this files are ready made, or i need to create my own *.h header file about the bits on INTCON?

Best Regards
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Jan 25, 2009 2:22 am     Reply with quote

Quote:
By the way, where to get "PIC16F887_registers.h"

>
Quote:
The device editor tool can make an include file automaticly.
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

My compiler never add the header file
PostPosted: Sun Jan 25, 2009 5:34 am     Reply with quote

Thanks for the reply FvM. Very Happy But i still have errors on undefined identifier for RBIF, RBIE, PORTB, TMR1IF, TMR1, CARRY, TMR1ON. Any idea why my compiler can't compile? By the way, i'm using CCs C Compiler version 4.020
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Jan 25, 2009 5:54 am     Reply with quote

The SFR definitions are apparently missing, e.g.:
Code:
#byte INTCON = 0x00B
#bit    RBIF = INTCON.0

You can also add these definitions manually, using the SFR addresses from the datasheet. But Device Editor eases this operation, although it creates some double entries, that have to removed to make the file compile correctly.
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

Minor Problem
PostPosted: Mon Jan 26, 2009 12:25 pm     Reply with quote

I'd include "#include <PIC16F887_registers.h>" and it does reduce the numbers of errors. Thanks to Frank who emailed me this header file. Since TMR1 is 32 bits, it's defined as "#word TMR1 = 0x00E" but the errors pop up saying it's undefined identifier. What's the problem?

Thanks in Advance
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Jan 26, 2009 2:17 pm     Reply with quote

The code compiled O.K. with PCM V4.084
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

Cannot read
PostPosted: Fri Jan 30, 2009 2:40 am     Reply with quote

The codes compiled ok after i upgrade to 4.084. But It's not working.... Maybe my idea was wrong on reading manchester code from U2270. Anyone have better idea on getting series of 1 and 0 from U2270. Sad
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

Manchester decoding
PostPosted: Sat Jan 31, 2009 11:55 pm     Reply with quote

Can done by fast io.... Using interrupt, it worst the condition

Last edited by viknes1985 on Fri Mar 20, 2009 12:24 pm; edited 1 time in total
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

anyone
PostPosted: Fri Feb 06, 2009 9:14 am     Reply with quote

anyone can help me to find where's my code problem. Why it's not working?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 06, 2009 12:07 pm     Reply with quote

Quote:
Is there any method to get the output in binary form?

See the routines in this thread. They show how to display bytes or words
in binary format (1's and 0's):
http://www.ccsinfo.com/forum/viewtopic.php?t=29265
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Feb 06, 2009 12:34 pm     Reply with quote

The binary data display problem has been already clarified in another thread (http://www.ccsinfo.com/forum/viewtopic.php?t=37595), so far the above code is legacy. However, it hasn't been ever said, what the actual problem with the code is supposed to be.
viknes1985



Joined: 11 Nov 2008
Posts: 24

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

Stuck at here
PostPosted: Wed Feb 25, 2009 10:02 pm     Reply with quote

Code:
               #asm
                  rlf STAC+7,f
                  rlf STAC+6,f
                  rlf STAC+5,f
                  rlf STAC+4,f
                  rlf STAC+3,f
                  rlf STAC+2,f
                  rlf STAC+1,f
                  rlf STAC+0,f
               #endasm


this function not seems to work.... is there any other function to rotate this 8 bytes?

can used rotate_left or shift_left


Last edited by viknes1985 on Fri Mar 20, 2009 12:26 pm; edited 1 time in total
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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