I2C Scanner buffer ssp1buf

Rickg1

New Member
Is this the same location ($91) for all the m2 units? Where did we come to know of it and value? Are there other hidden treasures in side that the every day experimenter might want to know about?
Thanks you for answers.
 

Rickg1

New Member
The detail is to be found in Microchip's datasheet for the raw PIC, that a specific PICAXE uses.

See: http://www.picaxe.com/What-is-PICAXE/PICAXE-Chip-Labels/

(I've not checked - but it wouldn't surprise me if the 18M2 was different to the other M2's...)
I'm sorry, but I,m lost. Have looked are the data sheet for 08m2 ( which I'm using) and am lost in finding that "value". Please help!
I have found the SSp1buf register, but it reads location is 211h, both for 14m2 and 08m2. How does it get to $91 as in i2c scanner code?
 
Last edited:

PhilHornby

Senior Member
No, you need to look in the datasheet for the PIC12F1840, which is the PIC into which the 08M2 Picaxe firmware is loaded.

On Page 23 of said datasheet, you'll find that SSP1BUF has a value of 211h. This has to be manipulated a little, for use with the PeekSFR/PokeSFR commands:-

Code:
;  2    1   1
;0010 0001 0001
; |   |xx|   /       xx = discarded
;  \  / /   /
; 1001 0001/
;   9    1
(Basically, discard the middle two bits of the 2nd nybble)
 

PhilHornby

Senior Member
(I had a quick scan through the datasheets for the 08M2,14M2,18M2 & 20M2.
SSP1BUF has the same value (211h), or 91h in Picaxe terms, in each case.)
 

AllyCat

Senior Member
Hi
Are there other hidden treasures in side that the every day experimenter might want to know about?
Yes, plenty, but it can be quite "hard work". Timers, various gates and latches, Comparators, ADC, DAC, serial ports, etc..

I usually start with the "Pin Allocation Table" around page 3 of the base data sheet. That will give a few clues about what's available and in which section (module) it should be found, e.g. section 25: MSSP for the I2C (and SPI ) bus. The end of the section should list all the relevant flags and registers (SFRs) which are tabulated in section 3.3.2. Then multiply the "Bank number" by 32 and add to the lower (5) bits in the SFR number to give the "PICaxe address". Note that any attempt to use the "core registers" (0 - 11) will cause the PICaxe to instantly reset.

Cheers, Alan
 

Rickg1

New Member
Thank you thank!!! Question- how do WE know to do the mod to the 211h?
May be I'm too thick but i don't get this multiply by 32 and the rest of it to get an pic address of 91. Please explain more.
 
Last edited:

hippy

Technical Support
Staff member
(I had a quick scan through the datasheets for the 08M2,14M2,18M2 & 20M2.
SSP1BUF has the same value (211h), or 91h in Picaxe terms, in each case.)
Many thanks for checking.

On Page 23 of said datasheet, you'll find that SSP1BUF has a value of 211h. This has to be manipulated a little, for use with the PeekSFR/PokeSFR commands:-
I used to have a nice graphic but I cannot find that now, but as you suggest, and how I would draw it -
Code:
$211 = 0010 0001 0001
         || |  | ||||
         10 0  1 0001
         \\ \  | ||||
          \\ \ | ||||
           \\ || ||||
            1001 0001 => $91
 

hippy

Technical Support
Staff member
Are there other hidden treasures in side that the every day experimenter might want to know about?
For the M2 devices the greatest treasure is probably the Data Signal Modulator (DSM). This allows a single output to be selected from two sources, effectively a hardware 2-to-1 multiplexor.
 

AllyCat

Senior Member
Hi,

IMHO,, particularly for the 08M2, the DSM is rather "greedy" of pins. So for me, the "treasures" are the Comparator(s), (one in the 08M2, two for the others) particularly when associated with the "DAC" internal divider and bias network.

For the 08M2, the main "bottleneck" is generally pin C.2 which is allocated to SDA, PWM and Comparator Outputs, etc..

Cheers, Alan.

PS (to edit in #7): The "PIC address" is NOT 91, it is $91 (or decimal 145).. You can make it up from individual bits (%1001 0001) as described by hippy, the bits arranged in "Hex" format ($91) or as decimal 4 * 32 + 17 = 145 (since $20 = 32 and $11 = 17).
 
Last edited:

Rickg1

New Member
Thanks so much guys. I got it finally. The manual is not so clear about ( bank # and then position in the bank ) Oh and thanks for the info, cant wait to dig into it. Thanks again for the help.
 

westaust55

Moderator
Rickg,
You may also be interested in the memory maps and SRF maps that I have previously developed:
See this thread:
 

hippy

Technical Support
Staff member
A complete list of M2 PICmicro SFR addresses converted to what needs to be used as PEEKSFR or POKESFR addresses is given below -
Code:
$00C => $0C     $08C => $2C     $10C => $4C     $18C => $6C
$00D => $0D     $08D => $2D     $10D => $4D     $18D => $6D
$00E => $0E     $08E => $2E     $10E => $4E     $18E => $6E
$00F => $0F     $08F => $2F     $10F => $4F     $18F => $6F
$010 => $10     $090 => $30     $110 => $50     $190 => $70
$011 => $11     $091 => $31     $111 => $51     $191 => $71
$012 => $12     $092 => $32     $112 => $52     $192 => $72
$013 => $13     $093 => $33     $113 => $53     $193 => $73
$014 => $14     $094 => $34     $114 => $54     $194 => $74
$015 => $15     $095 => $35     $115 => $55     $195 => $75
$016 => $16     $096 => $36     $116 => $56     $196 => $76
$017 => $17     $097 => $37     $117 => $57     $197 => $77
$018 => $18     $098 => $38     $118 => $58     $198 => $78
$019 => $19     $099 => $39     $119 => $59     $199 => $79
$01A => $1A     $09A => $3A     $11A => $5A     $19A => $7A
$01B => $1B     $09B => $3B     $11B => $5B     $19B => $7B
$01C => $1C     $09C => $3C     $11C => $5C     $19C => $7C
$01D => $1D     $09D => $3D     $11D => $5D     $19D => $7D
$01E => $1E     $09E => $3E     $11E => $5E     $19E => $7E
$01F => $1F     $09F => $3F     $11F => $5F     $19F => $7F
Code:
$20C => $8C     $28C => $AC     $30C => $CC     $38C => $EC
$20D => $8D     $28D => $AD     $30D => $CD     $38D => $ED
$20E => $8E     $28E => $AE     $30E => $CE     $38E => $EE
$20F => $8F     $28F => $AF     $30F => $CF     $38F => $EF
$210 => $90     $290 => $B0     $310 => $D0     $390 => $F0
$211 => $91     $291 => $B1     $311 => $D1     $391 => $F1
$212 => $92     $292 => $B2     $312 => $D2     $392 => $F2
$213 => $93     $293 => $B3     $313 => $D3     $393 => $F3
$214 => $94     $294 => $B4     $314 => $D4     $394 => $F4
$215 => $95     $295 => $B5     $315 => $D5     $395 => $F5
$216 => $96     $296 => $B6     $316 => $D6     $396 => $F6
$217 => $97     $297 => $B7     $317 => $D7     $397 => $F7
$218 => $98     $298 => $B8     $318 => $D8     $398 => $F8
$219 => $99     $299 => $B9     $319 => $D9     $399 => $F9
$21A => $9A     $29A => $BA     $31A => $DA     $39A => $FA
$21B => $9B     $29B => $BB     $31B => $DB     $39B => $FB
$21C => $9C     $29C => $BC     $31C => $DC     $39C => $FC
$21D => $9D     $29D => $BD     $31D => $DD     $39D => $FD
$21E => $9E     $29E => $BE     $31E => $DE     $39E => $FE
$21F => $9F     $29F => $BF     $31F => $DF     $39F => $FF
Please note that '$x00' through '$x0B' registers are not accessible.
 
Top