nurquhar
Joined: 05 Aug 2006 Posts: 149 Location: Redditch, UK
|
MachX and #Serilize don't work |
Posted: Wed Aug 23, 2006 7:43 am |
|
|
I have just reported the following problem to CCS Suuport :
I am using the following #serialise in my source code for a 16F648A to put an const int32 at the top of memory, in this case 0xFF0
Code: | // Determine the location at the top of memory to locate the UID
#define PROGRAM_SIZE getenv("PROGRAM_MEMORY")
#define CONST_SIZE 16
#define CONST_BEGIN (PROGRAM_SIZE - CONST_SIZE)
#define CONST_END (PROGRAM_SIZE - 1)
//Retrieves serial number from serials.txt
//const uint32 ROM_UID = 1 ;
#org CONST_BEGIN,CONST_END
unsigned int32 const ROM_UID = SET_ROM_UID ;
#serialize(id=ROM_UID,file="serials.txt",log="seriallog.txt") |
This produces the following comment in the hex file that MachX will be looking for :
:10128000AE008A11831273258A1504308316AD00CF
:10129000AE018A11831273258A150000AC28630001
:0A1FE000820701340034003400349D
:02400E00023F6F
:00000001FF
;BURNTIME 00FF1,00FF4 BINARY NEXTFILE="SERIALS.TXT" LOG="SERIALLOG.TXT"
;PIC16F648A
Every thing is fine so far, however when it programs the chip it puts RETLW's at 0x8CD, bang in the middle of me code !! Also where the values should be at 0xFF1 there is no change to the default value. ie the MachX has put the value in completley the wrong place.
This is what I read back from the chip with the programmer when using with and without Auto Serial No :
2241 08C0 3003 MOVLW 0x3
2242 08C1 00AE MOVWF 0x2e
2243 08C2 118A BCF 0xa, 0x3
2244 08C3 1283 BCF 0x3, 0x5
2245 08C4 2573 CALL 0x573
2246 08C5 158A BSF 0xa, 0x3
2247 08C6 3001 MOVLW 0x1
2248 08C7 1683 BSF 0x3, 0x5
2249 08C8 00AD MOVWF 0x2d
2250 08C9 01AE CLRF 0x2e
2251 08CA 118A BCF 0xa, 0x3
2252 08CB 1283 BCF 0x3, 0x5
- 2253 08CC 340A RETLW 0xa
- 2254 08CD 3400 RETLW 0
- 2255 08CE 3400 RETLW 0
- 2256 08CF 3400 RETLW 0
2257 08D0 01AD CLRF 0x2d
2258 08D1 01AE CLRF 0x2e
2259 08D2 118A BCF 0xa, 0x3
2260 08D3 1283 BCF 0x3, 0x5
2261 08D4 2573 CALL 0x573
It should have been
2241 08C0 3003 MOVLW 0x3
2242 08C1 00AE MOVWF 0x2e
2243 08C2 118A BCF 0xa, 0x3
2244 08C3 1283 BCF 0x3, 0x5
2245 08C4 2573 CALL 0x573
2246 08C5 158A BSF 0xa, 0x3
2247 08C6 3001 MOVLW 0x1
2248 08C7 1683 BSF 0x3, 0x5
2249 08C8 00AD MOVWF 0x2d
2250 08C9 01AE CLRF 0x2e
2251 08CA 118A BCF 0xa, 0x3
2252 08CB 1283 BCF 0x3, 0x5
- 2253 08CC 2573 CALL 0x573
- 2254 08CD 158A BSF 0xa, 0x3
- 2255 08CE 28DF GOTO 0xdf
- 2256 08CF 1683 BSF 0x3, 0x5
- 2257 08D0 01AD CLRF 0x2d
2258 08D1 01AE CLRF 0x2e
2259 08D2 118A BCF 0xa, 0x3
2260 08D3 1283 BCF 0x3, 0x5
2261 08D4 2573 CALL 0x573
As when support get back with an explanation/solution I will post again. |
|