Jump to content

Angosity

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Angosity

  • Rank
    Newbrie
  1. I was trying to use the boostc sample i2c code with the EEPROM plugin. However this fails when it checks for a free bus and there is not a simulation device for a pull up resistor so the port reads 0 when it should be 1. I tried to use the built in pullups of portb and this worked as far as the bus was concerned but the plugin would not respond. I have concluded so far that the plugin will only respond if portc is used and even then only if SCL - RC0 and SDA - RC1. Changing the code to anything else results in the plugin not responding. I have succeeded using the plugin sample code i2c.c by Mark Duren. It does not appear to matter what settings are used for the plugin configuration SCL and SDA. I would like to use other ports/bits for future projects so I would like to know if my plugin is not working correctly. I would appreciate any comments.
  2. I have written a program for 16F84 using char array and I want to move it to rom to save ram space. If I compile using const unsigned char patterns [26] = { 2, 7, 5, 3, 1, 13, 1, 15, 3, 8, 2, 11, 0, 1, 0, 9, 2, 5, 7, 0, 6, 14, 4, 6, 4, 3 } ; void main ( void ) { unsigned char a; a = patterns[1]; } ram usage is 27 bytes Heap 41 ROM used 58 words If I change it to rom const unsigned char patterns [26] = { 2, 7, 5, 3, 1, 13, 1, 15, 3, 8, 2, 11, 0, 1, 0, 9, 2, 5, 7, 0, 6, 14, 4, 6, 4, 3 } ; I get Ram usage 31 bytes Heap 37 bytes and ROM used 53 words Looking at the asm files it seems that Boostc is allocating the ram space for variable patterns in both cases. If rom keyword is used then a lookup table is written to rom while if rom is not used an equivalent use is made of rom to write the values in the ram. This explains why the rom usage is similar in both cases. However I do not understand why the Ram is allocated when the rom keyword is used Extract from asm when rom is used gbl_intcon EQU 0x0000000B ; bytes:1 gbl_patterns EQU 0x0000000C ; bytes:26 main_1_a EQU 0x00000026 ; bytes:1 when rom is not used gbl_intcon EQU 0x0000000B ; bytes:1 gbl_patterns EQU 0x0000000C ; bytes:26 main_1_a EQU 0x00000026 ; bytes:1 How do I stop the ram allocation when keyword rom is used?
×
×
  • Create New...