I am passing a constant to a procedure with the following def:
void command_lcd(int8 command)
{
....
PORTD = command;
....
}
This procedure is called in the main loop to as part of the lcd init procedure:
void lcd_init()
{
command_lcd(6);
command_lcd(12);
.....
}
main
{
....
init_lcd();
....
}
My problem is the following: The correct value does not reach PORTD unless init_lcd() in the main loop is preceded by a BSR = 0 command. Is this normal? Can somebody please explain.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10883
:=I am passing a constant to a procedure with the following def:
:=void command_lcd(int8 command)
:={
:=....
:= PORTD = command;
:=....
:=}
:=This procedure is called in the main loop to as part of the lcd init procedure:
:=void lcd_init()
:={
:= command_lcd(6);
:= command_lcd(12);
:= .....
:=}
:=main
:= {
:= ....
:= init_lcd();
:= ....
:= }
:=My problem is the following: The correct value does not reach PORTD unless init_lcd() in the main loop is preceded by a BSR = 0 command. Is this normal? Can somebody please explain.
What version of the compiler are you using?
I recently completed (I hope!) a project I switched over to a PIC18F452 and found a few "bugs" in the compiler mostly to do with the handling of the memory page select bits. I was using approx 900 bytes of the RAM and had to place #locate statements to manually place almost all of my varaible into specific page banks. Once I had done this most of the odd problems went away.
For example I found some problems with the compiler placing arrays across page banks. I did not take the time to verify that it generated the proper assembly to handle the page selections properly but it definitely caused problems for me. Once I moved all my arrays to manually selected areas those problems dissapeared.
I just wish they would provide a list of known issues so we all don't have to waste time troubleshooting things that are known to be bad. I do understand that the compiler is a work in progress but we knew ahead of time all the known issues it would make troubleshooting easier.
-Troy
___________________________
This message was ported from CCS's old forum
Original Post ID: 10887
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