Talking to the microcontroller

3 replies [Last post]
kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010

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

I have tried turning off the xap_livebox process since that is using /dev/ttyS0.

Not a linux expert so would welcome help on how to get the magic +++ debug message??

I am accessing using telnet and typing "ls -l /dev/ttyS0" seems to show the port is there.

Still enjoying it - want to get this bit sorted before connecting up the power lead and rf board.

Kim 

p.s If I kill the xap-currentcost process and do a "microcom -s 4800 /dev/ttyUSB0" I get lots of lovely data

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Debug disabled

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

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Thanks once again for the

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

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
New chip coming soon(ish)

 

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.

Hardware Info