Joined: 28 Mar 2008 Posts: 6 Location: 70 Industrial Way Wilmington, ma 01887
Inline assembly question with PCWHD CCS C compiler 4.071
Posted: Thu Apr 10, 2008 6:30 am
I built the PIC24H Demo code for Explorer 16 Board that came with my Microchip Explorer 16 Board using the Microchip C 30 compiler. Now I am porting the code to the CCS C compiler. So far so good.
void Delay( unsigned int delay_count )
{
temp_count = delay_count +1;
#asm
outer:
dec _temp_count
cp0 _temp_count <= this is line 51
bra z, done
repeat #3200
nop
repeat #3200
nop
bra outer
done:
#endasm
}
************************
Any ideas?
Thanks
Ken
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Thu Apr 10, 2008 7:17 am
I suggest you use the CCS supplied functions delay_us() and delay_ms(). These function names are more descriptive than the Microchip delay() and delay_us() combination. Also in CCS style you can call the function directly with the desired delay instead of having to use a defined value.
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