Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

can it be use the code?

Status
Not open for further replies.

alkid

Junior Member level 1
Joined
Sep 24, 2007
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,464
Could the source code for written for c8051F320 be use for c8051F120?
void Test_TX(void)
{
Led1 = Led2 = Led3 = Led4 = 1; // Clear status Led's

SPI_RW_Reg(WRITE_REG + SETUP_AW, (TX_AW-2)); // Setup RX/TX address width
SPI_Write_Buf(WRITE_REG + TX_ADDR,TX_ADDRESS_,TX_AW); // Writes TX_Addr
SPI_Write_Buf(WRITE_REG + RX_ADDR_P0, RX_ADDRESS_,RX_AW); // Writes RX_Addr, Pipe0 for auto.ack

SPI_Write_Buf(WR_TX_PLOAD,TX_PAYLOAD_,TX_PL_W); // Writes TX payload

SPI_RW_Reg(WRITE_REG + STATUS, 0x70); // Read status & clear IRQ flag's
SPI_RW_Reg(WRITE_REG + EN_AA, 0x01); // Enable auto ack pipe0
SPI_RW_Reg(WRITE_REG + EN_RXADDR, 0x01); // Enable pipe0
SPI_RW_Reg(WRITE_REG + SETUP_RETR,0x0a); // 250µs+86µs, 10 retrans...
SPI_RW_Reg(WRITE_REG + RF_CH, 40); // Channel 40

SPI_RW_Reg(WRITE_REG + CONFIG, 0x0e); // PWR_UP, CRC(2bytes) & Prim:TX.

while(!SW1); // wait until SW1 released
Led1 = 0; // Led1 indicates TX mode
EX0 = 1; // Enable External Interrupt0
}
 

If the only difference is the amount of internal memory there should be no problem using the same code.
 

c8051f320 have 2304 Bytes Internal RAM (1k+256+1k FIFO) & 16k Bytes FLASH; In-system programmable in 521-byte Sector.
c8051f120 have 8448 Bytes Internal Data RAM (8k+256), 128k or 64k Bytes Banked FLASH; In-System programmable in 1024-byte Sectors & external 64k Byte Data Memory Interface (programmable multiplexed or non-multiplexed modes).
but the c8051f120 has sfr-paging so i don't know confused...
 

your c compiler should take care of the memory, you just have to write the code.
 

they have same specifications but difference is in memories length, if you code adust well then it will run exactly the same and in codin you have to tell your compiler and adjust the memory lenght.
 

oo tks for the help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top