:=How can I define the FSR names to the memory location in PCH. In PCM I would create a #Byte statement with the memory address of the FSR in question. This method doesn't seem to work for PCH though.
:=
:=Paul
___________________________
This message was ported from CCS's old forum
Original Post ID: 10264

As you can see FSR0 is defined as a single byte but a write attempt handles it as a 16-bit word
I think this is true for Timer registers, etc. (16-bit hardware registers)

:=How can I define the FSR names to the memory location in PCH. In PCM I would create a #Byte statement with the memory address of the FSR in question. This method doesn't seem to work for PCH though.
:=
:=Paul
___________________________
This message was ported from CCS's old forum
Original Post ID: 10270

Mark

Joined: 07 Sep 2003Posts: 2838Location: Atlanta, GA

Re: PCH FSR access

Posted: Fri Dec 27, 2002 9:21 am

In that case, CCS will probably change it and it will no longer work in the future. Why not do it this way?

long FSR0;
#locate FSR0 = 0xFE9

FSR0 = 0x1234;

Regards,
Mark

:=There is a small confuse in CCS C about byte/word registers.
:=This works for me:
:=#byte FSR0 = 0xFE9
:=........
:=FSR0 = 0x1234;
:= The list:
:=.................... FSR0 = 0x1234;
:=0342: MOVLW 12
:=0344: MOVWF FSR0H
:=0346: MOVLW 34
:=0348: MOVWF FSR0L
:=
:=As you can see FSR0 is defined as a single byte but a write attempt handles it as a 16-bit word <img src="http://www.ccsinfo.com/pix/forum/smile.gif" border="0">
:=I think this is true for Timer registers, etc. (16-bit hardware registers)
:=
:=
:=:=How can I define the FSR names to the memory location in PCH. In PCM I would create a #Byte statement with the memory address of the FSR in question. This method doesn't seem to work for PCH though.
:=:=
:=:=Paul
___________________________
This message was ported from CCS's old forum
Original Post ID: 10271

Paul KleisslerGuest

Re: PCH FSR access

Posted: Fri Dec 27, 2002 2:55 pm

Great Ideas I will give them a try.

Paul

:=In that case, CCS will probably change it and it will no longer work in the future. Why not do it this way?
:=
:=long FSR0;
:=#locate FSR0 = 0xFE9
:=
:=FSR0 = 0x1234;
:=
:=Regards,
:=Mark
:=
:=:=There is a small confuse in CCS C about byte/word registers.
:=:=This works for me:
:=:=#byte FSR0 = 0xFE9
:=:=........
:=:=FSR0 = 0x1234;
:=:= The list:
:=:=.................... FSR0 = 0x1234;
:=:=0342: MOVLW 12
:=:=0344: MOVWF FSR0H
:=:=0346: MOVLW 34
:=:=0348: MOVWF FSR0L
:=:=
:=:=As you can see FSR0 is defined as a single byte but a write attempt handles it as a 16-bit word <img src="http://www.ccsinfo.com/pix/forum/smile.gif" border="0">
:=:=I think this is true for Timer registers, etc. (16-bit hardware registers)
:=:=
:=:=
:=:=:=How can I define the FSR names to the memory location in PCH. In PCM I would create a #Byte statement with the memory address of the FSR in question. This method doesn't seem to work for PCH though.
:=:=:=
:=:=:=Paul
___________________________
This message was ported from CCS's old forum
Original Post ID: 10274