[Sdcc-user] overflow in supposed to be unsigned long

2011-05-03 Thread stoffer
Hi, I have to transmit an unsigned long as four bytes, so I split them up and join them again, but with the folowing example code, I get overflow at long_counter>32767 - can any of you give me a clue how to do it right?

[Sdcc-user] read microchip device id register

2014-06-17 Thread stoffer
Hi, I am looking for a way to get the Device ID Register at address 3Fh and 3Eh is Generic Pointers the way to go? but then those two adresses should be in code? Make no sense... uint8_t *eeprom = (void *)0xe; or are there another way? --

Re: [Sdcc-user] read microchip device id register

2014-06-17 Thread stoffer
On Jun 17, 2014, at 10:59 PM, stof...@skulp.net wrote: > > uint8_t *eeprom = (void *)0xe; this seems to work: unsigned int dev_id() { unsigned char dev_id_low, dev_id_high; TBLPTRU = __DEVID1 >> 16; TBLPTRH = __DEVID1 >> 8; TBLPTRL = __DEVID1; __asm