mailto: blog -at- heyrick -dot- eu

More on the MEMC CAM table

Yesterday we dumped the MEMC's CAM table.

Now to understand what to do with it.

To understand how this works, we need to understand the relationship between pages, logical memory, and physical memory.

Logical memory is broken into a set of pages. It is a 32MiB space divided evently by the page size. If the page size is 8192 bytes, as it would be on a 1MiB system, then there are 4096 possible pages in the logical memory map.
Any of these pages may be related to physical memory, in whatever arrangement the OS deems suitable. Indeed, the OS is free to map out chunks of physical memory entirely if it wishes.

Now to the physical memory. This is arranged as a sequential set of pages, starting at the beginning and counting up. Page zero (in the CAM table) is the first page in physical memory, page one in the next, and so on. The order does not change.

Now to the CAM table. When you run CAMdump, you will see something like this:

  0: &01FEC000 (Read/Write)     1: &01FEE000 (Read/Write)
  2: &01FF0000 (Read/Write)     3: &01FF2000 (Read/Write)
  4: &01FF4000 (Read/Write)     5: &01FF6000 (Read/Write)

What this is telling us is that the first (zeroth) 8192 bytes of physical memory (we're using an 8KiB page size here) corresponds to the logical address &1FF0000.

Given that the MEMC will allow us to access memory by it's logical mapping or it's physical address, we can try this.

On an old machine, go to the command line and start BASIC, then run CAMdump.

*BASIC
ARM BBC BASIC V version 1.05 (C) Acorn 1989

Starting with 4348 bytes free.

>*CAMdump
This is RISC OS 3.11, using new style page tables.

Your machine has 1048576 bytes of memory and a page size
of 8192 bytes. There are 128 pages (using 1 MEMC).

Dumping MEMC CAM table (stored at &00000164):

  0: &01FEC000 (Read/Write)     1: &01FEE000 (Read/Write)
  2: &01FF0000 (Read/Write)     3: &01FF2000 (Read/Write)
  4: &01FF4000 (Read/Write)     5: &01FF6000 (Read/Write)
  6: &01FF8000 (Read/Write)     7: &01FFA000 (Read/Write)
  8: &01FFC000 (Read/Write)     9: &01FFE000 (Read/Write)
 10: &01C06000 (Read/Write)    11: &01818000 (Read/Write)
 12: &0181A000 (Read/Write)    13: &0181C000 (Read/Write)
 14: &01F08000 (Nowhere)       15: &01F08000 (Nowhere)
 16: &01F08000 (Nowhere)       17: &01820000 (Read/Write)
 18: &01F08000 (Nowhere)       19: &00008000 (Read/Write)
 20: &01800000 (Read/Write)    21: &01E00000 (Inaccessible)
 22: &01E02000 (Inaccessible)  23: &01E04000 (Inaccessible)
 24: &01E06000 (Inaccessible)  25: &01F08000 (Nowhere)
 26: &01F08000 (Nowhere)       27: &01F08000 (Nowhere)
 28: &01F08000 (Nowhere)       29: &01F08000 (Nowhere)
 30: &01F08000 (Nowhere)       31: &01F08000 (Nowhere)
 32: &01F08000 (Nowhere)       33: &01F08000 (Nowhere)
 34: &01F08000 (Nowhere)       35: &01F08000 (Nowhere)
 36: &01F08000 (Nowhere)       37: &01F08000 (Nowhere)
 38: &01F08000 (Nowhere)       39: &01F08000 (Nowhere)
 40: &01F08000 (Nowhere)       41: &01F08000 (Nowhere)
 42: &01F08000 (Nowhere)       43: &01F08000 (Nowhere)
 44: &01F08000 (Nowhere)       45: &01F08000 (Nowhere)
 46: &01F08000 (Nowhere)       47: &01F08000 (Nowhere)
 48: &01F08000 (Nowhere)       49: &01F08000 (Nowhere)
 50: &01F08000 (Nowhere)       51: &01F08000 (Nowhere)
 52: &01F08000 (Nowhere)       53: &01F08000 (Nowhere)
 54: &01F08000 (Nowhere)       55: &01F08000 (Nowhere)
 56: &01F08000 (Nowhere)       57: &01F08000 (Nowhere)
 58: &01F08000 (Nowhere)       59: &01F08000 (Nowhere)
 60: &01F00000 (Read Only)     61: &01F02000 (Read Only)
 62: &01F04000 (Read Only)     63: &01F06000 (Read Only)
 64: &00000000 (Read/Write)    65: &00002000 (Read/Write)
 66: &00004000 (Read/Write)    67: &00006000 (Read/Write)
 68: &01C00000 (Read/Write)    69: &01C02000 (Read/Write)
 70: &01C04000 (Read/Write)    71: &01F08000 (Nowhere)
 72: &01F08000 (Nowhere)       73: &01F08000 (Nowhere)
 74: &01F08000 (Nowhere)       75: &01F08000 (Nowhere)
 76: &01F08000 (Nowhere)       77: &01F08000 (Nowhere)
 78: &01F08000 (Nowhere)       79: &01F08000 (Nowhere)
 80: &01F08000 (Nowhere)       81: &01F08000 (Nowhere)
 82: &01F08000 (Nowhere)       83: &01F08000 (Nowhere)
 84: &01F08000 (Nowhere)       85: &01F08000 (Nowhere)
 86: &01F08000 (Nowhere)       87: &01F08000 (Nowhere)
 88: &01F08000 (Nowhere)       89: &01F08000 (Nowhere)
 90: &01F08000 (Nowhere)       91: &01F08000 (Nowhere)
 92: &01F08000 (Nowhere)       93: &01F08000 (Nowhere)
 94: &01F08000 (Nowhere)       95: &01F08000 (Nowhere)
 96: &01F08000 (Nowhere)       97: &01F08000 (Nowhere)
 98: &01F08000 (Nowhere)       99: &01F08000 (Nowhere)
100: &01F08000 (Nowhere)      101: &01F08000 (Nowhere)
102: &01F08000 (Nowhere)      103: &01F08000 (Nowhere)
104: &01F08000 (Nowhere)      105: &01F08000 (Nowhere)
106: &01F08000 (Nowhere)      107: &01F08000 (Nowhere)
108: &01F08000 (Nowhere)      109: &01F08000 (Nowhere)
110: &01F08000 (Nowhere)      111: &01F08000 (Nowhere)
112: &0181E000 (Read/Write)   113: &01F08000 (Nowhere)
114: &01F08000 (Nowhere)      115: &01F08000 (Nowhere)
116: &01F08000 (Nowhere)      117: &01816000 (Read/Write)
118: &01814000 (Read/Write)   119: &01812000 (Read/Write)
120: &01810000 (Read/Write)   121: &0180E000 (Read/Write)
122: &0180C000 (Read/Write)   123: &0180A000 (Read/Write)
124: &01808000 (Read/Write)   125: &01806000 (Read/Write)
126: &01804000 (Read/Write)   127: &01802000 (Read/Write)
>

Now, the reason we started BASIC is because it writes an identity to the start of workspace, at address &8000, as can be seen by the next command:

>*Memory 8000 +32

Address  :     3 2 1 0     7 6 5 4     B A 9 8     F E D C :    ASCII Data
00008000 :    204D5241    20434242    49534142    20562043 : ARM BBC BASIC V 
00008010 :    73726576    206E6F69    35302E31    29432820 : version 1.05 (C)
00008020 :    6F634120    31206E72    0A393839    0000000D :  Acorn 1989.....
>

Now, looking at the CAM table, we can see that the address &8000 is mapped in as entry 19. Which means that it ought to correspond to the 19th block of 8192 bytes in physical memory. So a quick calculation will give us an address to check:

>PRINT ~&2000000 + (19 * 8192)
   2026000
>*Memory 2026000 +32

Address  :     3 2 1 0     7 6 5 4     B A 9 8     F E D C :    ASCII Data
02026000 :    204D5241    20434242    49534142    20562043 : ARM BBC BASIC V 
02026010 :    73726576    206E6F69    35302E31    29432820 : version 1.05 (C)
02026020 :    6F634120    31206E72    0A393839    0000000D :  Acorn 1989.....
>

There you go. The physical address corresponding to the logical one. We can verify this by modifying the data slightly. We'll change some of the words of the second line of that memory dump.

>*MemoryA 2026010
+ 02026010 : vers : 73726576 : CMNVC   R2,#&1D800000
  Enter new value : 0
                  . 00000000
+ 02026010 : .... : 00000000 : ANDEQ   R0,R0,R0
  Enter new value : 0
                  . 00000000
+ 02026010 : .... : 00000000 : ANDEQ   R0,R0,R0
  Enter new value : 
+ 02026014 : ion  : 206E6F69 : RSBCS   R6,R14,R9,ROR #30
  Enter new value : 0
                  . 00000000
+ 02026014 : .... : 00000000 : ANDEQ   R0,R0,R0
  Enter new value : 
+ 02026018 : 1.05 : 35302E31 : LDRCC   R2,[R0,#-3633]!
  Enter new value : 0
                  . 00000000
+ 02026018 : .... : 00000000 : ANDEQ   R0,R0,R0
  Enter new value : 
+ 0202601C :  (C) : 29432820 : STMCSDB R3,{R5,R11,R13}^
  Enter new value : 
Escape
>

The reason we alter the second line is because the "Escape" message is written to &8000. At any rate, three of the words of the second line are now zero.

Let's confirm this:

>*Memory 2026000 +32

Address  :     3 2 1 0     7 6 5 4     B A 9 8     F E D C :    ASCII Data
02026000 :    61637345    20006570    49534142    20562043 : Escape. BASIC V 
02026010 :    00000000    00000000    00000000    29432820 : ............ (C)
02026020 :    6F634120    31206E72    0A393839    0000000D :  Acorn 1989.....
>

Now, let's look at address &8000:

>*memory 8000 +32

Address  :     3 2 1 0     7 6 5 4     B A 9 8     F E D C :    ASCII Data
00008000 :    61637345    20006570    49534142    20562043 : Escape. BASIC V 
00008010 :    00000000    00000000    00000000    29432820 : ............ (C)
00008020 :    6F634120    31206E72    0A393839    0000000D :  Acorn 1989.....
>

Identical. So now we know what the CAM table is, and how it works.

 

Storm Alex

Storm Alex ble through on Thursday night. Originally predicted to pass right over, it luckily went a little further to the west. Here, it was breezy/windy and rained in varying degrees of strength from Thursday afternoon until this morning.

The worst of the wind passed over the Morbihan, further west. Some rooves removed, trees down, powerlines down. All schools in the area were closed on Friday. And the island of Belle Île-en-Mer recorded a new high wind speed of 186kph. That's something like a 17 on the revised Beaufort scale.
The reason there wasn't widespread devastation, as happened in, say Puerto Rico, is because that was a gust speed, not a sustained speed. A strong gust will cause damage, but having the wind contantly at 186kph would be a demonstration of immovable objects meeting an unstoppable force. Which, thankfully, was not the case.

Strangely enough, it looks like the worst hit is the area around Nice (and into Italy), down on the Med. Not because of the winds, but because of flooding. Roads and bridges washed away, but worse than that banks of rivers washed away leaving some buildings perched precariously with parts of their foundations missing, and others having collapsed into the waters. I can only guess that a part of the storm got stuck in the mountains and dumped all of its rain in one go.

Here? Anna checked everything over, told me there was nothing to worry about.

Anna checking the grounds.
Anna checking the grounds

 

Fridge temperature

As the outside temperature drops, so does the temperature inside the house. It's 13&dec;C in the kitchen. 14.4°C outside right now, but has been down around 6-7°C at night (that storm brought cold with it).

And the fridge? I can knock back the thermostat a little.

Well, I say "thermostat". In reality it is a rotating knob attached to a sensor in the icebox (that regularly freezes up) that seems to essentially choose entirely random amounts of "cold". It isn't like "this position here equates to an average of 4°C".

Fridge temperature adjustment
Fridge temperature adjustment

It is set quite high, because it was until recently warm in the kitchen, the ice box part needs defrosting again, and I like to keep cold stuff cold. Having the fridge be about 8°C inside is not useful.

I keep, on the middle shelf, a little Bluetooth temperature sensor to let me know what the temperature in the fridge is. It also maintains a history, so I can see it rise when I add shopping, to slowly come back down to it's anticipated temperature.

Bluetooth temperature sensor in fridge
Bluetooth temperature sensor in fridge

 

What I don't get, in this day and age, is why a fridge doesn't have a smarter arrangement for controlling its temperature. As has been demonstrated by my Tassimo coffee maker, it's possible to run a little microprocessor without a transformer, and also switching a load greater than a fridge's motor using a triac.
Therefore, what would be required is...

  • Some basic line filtering and a power slicer to get about 9-12V.
  • Two diodes and a capacitor to make it DC.
  • A 3.3V regulator to get the 3.3V required by the chip.
  • Two buttons.
  • Some sort of display.
  • A temperature sensor (thermistor).
  • A small microcontroller, probably some sort of Cortex-M0 device, but it doesn't need to be powerful.
  • Some wires and/or ribbon cable.
  • A small PCB (can mount the µC on the back of the display board to reduce costs).

I was originally thinking that two 7 segments LEDs would be all that's required to set/report the fridge temperature, but that might require extra hardware for decoding which display is to be controlled. An alternative could be a small OLED panel. These are pretty inexpensive (moreso in bulk) and controlled by IIC meaning it only needs four connections. Or, alternatively, a 1602 LCD with backlight. Easy to interface (IIC again), inexpensive, clear and easy to read.

It doesn't need to be capable of connecting to the internet, playing YouTube, and all the unnecessary crap that "smart" appliances offer these days. It needs only to allow the user to set a target temperature (say, 4°C) and to switch the fridge's motor on and off as necessary in order to maintain the internal temperature around the desired temperature. And, since it'll have a display, to report the current temperature.

That's all.

It doesn't need to add much to the bill of materials. If I was more confident messing with mains voltages, I would imagine I could probably put together something in a weekend for about €30 or so at ordering-from-Amazon prices. Easily half that if I get the stuff off eBay and shipped from China... In the sort of bulk and building capabilities of fridge manufacture, it would probably run to a few euros, some of which being offset by not having the mechanical stuff in place. But I'm sure they'd jack up the price a little because... tick box!
It isn't infeasible.

So why do you need to buy big expensive fridges before you get something that resembles a semi-capable temperature management, other than the hit'n'miss method of a twiddly knob?

 

Another Tassimo?

I had a quick peek inside my Tassimo, the one that I use. It's a Suny, I think. They give the things such peculiar names.

Anyway, the differences are mostly superficial. My Tassimo has a power sawitch on the side, and it's water tank around back (which better fits the kitchen as a flap opens up so the tank mostly comes out straight up).
There is also a so-called smart function (called "Intellibrew"™) for activating the coffee maker, in that you put your cup or mug under the spout, and briefly knock it backwards to the rear of the cup holder. This is mostly a gimmick, as instead of having a button that you push, it's a larger hinged piece of plastic that pushes the exact same button. Only you can use your hand or a mug to push the bit of plastic.

Internally, it's the same E410 pump, looks to be the same heater, the same STM32F030C8 microcontroller... The board is a different shape, more spaced out, as fits into the space. The eight pin programming connection is still present. I'd imagine it's probably the same firmware too.

Tassimo Suny motherboard
Tassimo Suny motherboard

The actual internal stuff? It's all the same. Indeed, apart from a slightly different mechanical arrangement with the tank around back and the power switch, it's pretty much the same stuff in a different shaped unit.
Odd, considering the prices of these things are all over.

Tassimo prices
Tassimo prices
In my local supermarket, the Vivy 2 is normally €49,99 (but currently on special for about €25). The Happy (I'm surprised that's not spelled "Hapy"!) is €69,99. And the Suny is €79.99.
What is it that justifies €30 between the Vivy 2 and the Suny, given that - asides from a power button - the only difference that I can determine is the shape? The Suny has a slightly larger water tank (0.8l vs 0.7l in the Vivy 2), both appear to be rated 1300W. The Happy, incidentally is 1400W.

 

 

Your comments:

Please note that while I check this page every so often, I am not able to control what users write; therefore I disclaim all liability for unpleasant and/or infringing and/or defamatory material. Undesired content will be removed as soon as it is noticed. By leaving a comment, you agree not to post material that is illegal or in bad taste, and you should be aware that the time and your IP address are both recorded, should it be necessary to find out who you are. Oh, and don't bother trying to inline HTML. I'm not that stupid! ☺ ADDING COMMENTS DOES NOT WORK IF READING TRANSLATED VERSIONS.
 
You can now follow comment additions with the comment RSS feed. This is distinct from the b.log RSS feed, so you can subscribe to one or both as you wish.

Rob, 5th October 2020, 19:59
We've got a big old "American fridge/freezer" style unit. It has digital readouts for the temperature in each half. I have no idea where its thermocouples are, though, as despite being set quite low (2C for the fridge) it never seems to get that cold. Except for the times the whole thing ices up. I really should rig up a thermometer..
David Pilling, 6th October 2020, 02:48
On thermostats, as the song says "Tradition!". Reliability may be a reason. If it goes wrong you lose something and may claim against the maker. There is cold, wet, and a large inductive load. All things to make a micro-controller go wobbly. Took a long time for electronics to be widely applied in cars. I remember how difficult it was to make anything work. 
The traditional fridge thermostats are not that great, they have a lifetime shorter than that of the fridge. Always remember when fitting a new one "don't trim the capillary" - told this by a fridge engineer whose cheese I was stealing, and I needed telling too. 

Add a comment (v0.11) [help?] . . . try the comment feed!
Your name
Your email (optional)
Validation Are you real? Please type 55507 backwards.
Your comment
French flagSpanish flagJapanese flag
Calendar
«   October 2020   »
MonTueWedThuFriSatSun
   2
5678910
1213141516
192122232425
26272930 

(Felicity? Marte? Find out!)

Last 5 entries

List all b.log entries

Return to the site index

Geekery
 
Alphabetical:

Search

Search Rick's b.log!

PS: Don't try to be clever.
It's a simple substring match.

Etc...

Last read at 04:41 on 2024/11/22.

QR code


Valid HTML 4.01 Transitional
Valid CSS
Valid RSS 2.0

 

© 2020 Rick Murray
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted.
RIPA notice: No consent is given for interception of page transmission.

 

Have you noticed the watermarks on pictures?
Next entry - 2020/10/11
Return to top of page