PDA

View Full Version : 12 bit core



Ruben Pena
- 5th December 2007, 19:14
Hi friends:
I have a question concerning the 12 bits core limitations. I understand you must use the first half of the 512 bytes to put the subrutines, and it works OK for the 512 byte devices. But if you use a 16F57 or 59, you have 2Kbytes and four possible sectors to put subroutines:From
00 to FF,200 to 2FF, 400 to 4FF and 600 to 6FF. The PBP handles this.?. If not, how can I put
some routines in other block (200h,400h or 600h)?. I am aware I need to keep trace of the stack limitations.
Any hint...?
Thanks in advance...
Ruben de la Pena

mister_e
- 5th December 2007, 19:56
maybe i missed something, but usually the compiler handle it for you.

Ruben Pena
- 6th December 2007, 00:09
Hi:
I had a program in a customer PCB. It had 450 bytes or so and compile ok with PBP. My customed asked to add one I2C eeprom using the same micro, but the PBP no not compile when the subs excedes the first 256 bytes. I made it in ASM and it works OK. I made several attempts in PBP because I like it more than ASM. I do not have tried with the new 2.5a extension of the PBP. Obviously, the customer dont want the change the PIC or the PCB.
The PCB was already prepared to receive the eeprom.
Thanks in advance...
Ruben de la Pena

mister_e
- 6th December 2007, 02:11
12 bit core have some limited support, so the 'hand-made' or asm solution have it's own benefits.

Did you looked over there...
http://melabs.com/support/12-bit.htm

I2CRead, I2CWrite: The I2C clock and data pins are fixed at compile time by Defines. They still must be specified in the I2CRead and I2CWrite statements, though this information is ignored by the compiler.

Define I2C_SDA PORTA,0
Define I2C_SCL PORTA,1

Because of memory and stack constraints, the Define for I2C_SLOW does not do anything. Low-speed (100 kHz) I2C devices may be used up to 4MHz. Above 4MHz, high-speed (400kHz) devices should be used.

The Define for I2C_HOLD has no effect.
'
'
'
'
'
.....Many library routines, such as I2CRead, are fairly large. It may only take a few routines to overrun the first 256 words of code space. If it is necessary to use more library routines that will fit into the first half of the first code page, it will be necessary to move to a 14- or 16-bit core PICmicro MCU instead of the 12-bit core device.


are you using multiple I2C line or you used it in a sub? I feel the sub idea may help.

Ruben Pena
- 6th December 2007, 19:04
Hi:
I tested with the pbp 2.50a and now it works. Thanks for your responses.
Greetings...
Ruben de la Pena