Talking to the microcontroller

OK - so great fun building the controller board.

Plugged it in and confirmed something was happening by clicking a relay - how exciting is that!

Plugged in the display - nothing - then found I had connected the ribbon cable to the connector the wrong 

way round - can confirm it doesn't blow up display and will work when connected right way round.

Having changed the display on the LCD - "hello world" - more excitement, I now want to talk to the controller

via /dev/ttyS0.  Using the command: "microcom -s 115200 /dev/ttyS0" - nothing happens

Member for

16 years 10 months

brett

15 years 10 months ago

Kim,

In the last firmware modification made to implement 0.1 of a degree readings for the temperature sensors on the 1wire bus the flash space was so tight all the interactive code was conditionally disabled.  I'm pretty sure its 96% of flash used before enabling the interactive code.  With only 1k RAM and 8k FLASH things started to get really tight so something had to go.

You can send commands to it and it will be listening but there will be no echo so its a little hard although possible if you know the code.

I should update the wiki notes as all that debug stuff is not possible until we move to the 168/328 chip at which point space permitting it can be re-enabled. 

We are planning on giving the HAH some new functionality like a programmable RF transmission sub-system so any RF device can be controlled, and a bootloader so the AVR firmware can be dynamically reflashed. Its early days but we are making progress on this.

Currently we are using a Mega8 and these other chips will provide the extra flash/ram we need.

  • M8 - 8KB Flash Program Memory, 1KB SRAM, 512 Byte EEPROM
  • 168 - 16KB Flash Program Memory, 1KB SRAM, 512 Bytes EEPROM
  • 328 - 32KB Flash Program Memory, 2KB SRAM, 1024 Bytes EEPROM

Brett

Member for

15 years 11 months

kim

15 years 10 months ago

Thanks once again for the prompt reply - now why didn't I think of that.

Of course it works perfectly - "on 1" and "off 1" gives a satisfying relay click and "lcd hello world" changes the display.

So now I know that bit of it works - and yes I would much prefer the nice smooth graph of 0.1 degree changes.

One final question - will the new microcontroller chips you mention work on the board I have just acquired?

Now I can add the 15v power and see if I can get the rf bit working.  

Regards

Kim

Member for

17 years

derek

15 years 10 months ago

 

Kim,

Good job on having your HAH up & running (despite the lack of interactive debug!).

Reckon that we will go for the Mega328 chip. It costs about the same as the (smaller) 168. Even with my bootloader code onboard it leaves 31K of codespace, so plenty of room for new functions, interactive debug and anything else that we can think of (perhaps commands to control the, currently unused, ten pin 'external relay' connector).

Re your question ... Fortunately, the 328 is pin compatible with the Mega8 that we currently use, so it's a drop in replacement. Even better, with the bootloader, we can release & end-users can deploy new code to the chip without having to remove it from the PCB.

Re your RF. The important piece is to make sure that the hex strings in your .ini file are the correct ones for your RF sockets.

As Brett mentioned, we are looking to remove the rather annoying limitation of needing different AVR code for each type of RF sockets. The generic RF capability is looking good (as ever, very smart code from Brett) with BBSB/HE Advanced protocol/Lidl sockets and the '3 for a fiver' sockets from Asda all having had their protocols mapped out and tested from a single codebase.

Derek.