View Single Post
  #5   Spotlight this post!  
Unread 08-02-2008, 13:46
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Printf prints only the first character

The last two calls are to routines that return single bytes... but the compiler automatically passes these as ints to the printf - for readability you can and the (int) or (unsigned int) case, but it won't change the code generated.
Code:
 

  RCALL EEPROM_Read                      
  MOVF POSTDEC1, F, ACCESS   ; pop the arg off  stack        
  MOVF POSTDEC1, F, ACCESS   ; pop 2nd byte of arg off stack
  MOVWF POSTINC1, ACCESS    ; push returned char onto stack
  CLRF POSTINC1, ACCESS        ; push 2nd byte of zeros onto stack
Try commenting out the printf with the 7 arguments. If that works, add back in arguments one at a time, i.e.

printf( "P: %d / %d\r\n", EEPROM_Read2Byte(EEPROM_ADDRESS_P_NUMERATOR),EEPRO M_Read2Byte(EEPROM_ADDRESS_P_DENOMINATOR)

Could be running up against variable stack limit (shouldn't be) or formated printf buffer limit...

Actually, I'll take that back... could be a variable stack limit depending on how the printf -> vprintf -> vfprintf -> ... is done vis-a-vis copying stack arguments.

Debug steps are the same, reduce the printf. Could change this into a series of printfs and leave off the \r\n until the last one in the series too.