Updated __interrupt and __using directives to use (...) syntax. This fixes examples...
[fx2lib.git] / NOTES
blobaff01c52def1ff5a35a4bcd0d485780d08d672f3
1 Notes on Various things I've learned about SDCC and the FX2
3 * libusb on Linux
4 * cycfx2prog: http://www.triplespark.net/elec/periph/USB-FX2/software/index.html
5  - most of this functionality is now in the fx2load package for python
6  - which is in examples/fx2
7 * sdcc has sdcc/support/scripts/keil2sdcc.pl which I used to create the fx2regs.h file from the keil header. 
8 * sdcc is little endian, keil is big endian (important if doing usb communication)
9 * xdata can go up to 64k on the EZ-USB development board but
10   - the fx2 chip itself only has 16k (end at 0x4000) Firmware written for other than the dev board
11   - should use --xram-size --xram-loc etc to make sure it isn't using memory beyond 16k.
12 * linux has objcopy, which can be used in place of Hex2bix for bix files 
13   - objcopy -I ihex -O binary --pad-to=8192 input [output]
16 Memory
17  * 256 bytes internal
18    - lower 128=registers/bits (direct or indirect)
19    - upper 128=stack (or whatever but only indirect addressing)
20    - sfs occupy upper 128 space only direct addressing
22  * external
23   - 16k on chip 0-0x3fff
24   - 512 bytes on chip scratch ram 0xe000 - 0xe1ff (data memory only)
25   - epbuffers and control at 0xe200-0xffff (data memory only)
26   
27    Only the on chip 16k and 512 bytes can be uploaded w/ eeprom or downloaded to host with SETUPPTR
28    Might be possible to load the descriptors to the scratch ram instead of code ram area?
30 sdcc data types
31   data/near=direct addressable internal memory (default for model-small)
32   xdata/far=external ram (default for model-large)
33   idata=indirect addressable internal memory
34   pdata=access to xdata area, but uses sfr to get to address (sdcc 4.1)
35   code=code memory, study this more.
36   bit=uses lower 128 bit area
37   
39 TODO:
40  * Possibly add CKCON and bmSTRETCH customization
41  * IN2CLR and INT4CLR registers can be used intead of explicitly clearing int2 and int4 interrupts. (Faster)
42    See (15.5)