AVR ASM Code availability?
Hi
Have my livebox running HAH since upgrading both the firmware and adding the hardware to it last weekend and had a great afternoon with a few beers upgrading it :-) and been logging both 1wire temperatures and CCost via pachube.
My goal for your unit is to control (remotely) heating and water of a property I have abroad, major WAF here.
But I was wondering if your AVR code is available as I am interested in modding it, firstly I have fitted a 2X16 blue back lit LCD display for the WAF and also I had one to hand in my workshop, due to the 1X16 code the display is not showing correctly.
I would also like to modify the code to display time and date, plus other scrolling info.
Also in my haste in ordering I didn't stipulate the Homeeasy RF protocol over the lidl protocol... I understand if it’s not and I look forward to release of the Atmega upgraded
Steve
Here's two links on how to upload a hex file to an arduino board - ie once you have generated the new hex file in Bascom.
http://xloader.russemotto.com/
http://www.ngcoders.com/downloads/arduino-hex-uploader-and-programmer
lets know how you get on with the 16*2 display
cheers
Harry
I uploaded the HEX for the 328 AVR code its currently stand (v2.2) you need to switch to the 279.13 BETA HAH firmware if you want to play with it Just flash an arduino up and then pop the chip into your existing HAH PCB and upgrade to your livebox /etc_ro_fs/update-dev hah-beta.dbzoo.com
http://code.google.com/p/livebox-hah/downloads/list
What new goodies do I get?
- Universal RF - Derek has reported that it locks up after a while which is why this isn't Production yet. I've not seen it do this thou.
- I2C PPE support for the 8 PPE chips + all PCF8574 variants.
- 1-WIRE ability to map a ROMID to an xAP endpoint.
- AVR firmware command line enabled - # microcom -s 115200 /dev/ttyS0 (make sure xap-livebox is stopped first)
The beta build autodetects the AVR chip so it you put back the M8 it will still work (minus any RF settings as these aren't compatible) - The WEB gui also auto detects and hides various unsupported features such as 1-WIRE ROM mapping.
One thing that might be an issue if you are building the xap-lua-engine (beta) branch. I used swig version 2.0.1 to build the LUA/C glue logic if you try to compile with an older version it just won't. Let me know if you run into issue compiling up this source branch as I've got a working copy on my dev box. I updated the cross compile tools a while back as they where missing some libraries, ncurses I think, and perhaps another that is needed for LUA. Just in case you have grabbed them before you might need to grab them again. Let me know how you get one with the code as not too many people except me, only cause I wrote it, have really sat down and examined it in detail. Hopeful you can follow my style. Personally the BASCOM is aweful and I'd really like to ditch it re-write in C but I just don't have the time and sadly it does work so there isn't much to be gained except some personally happiness.
Brett
You really should be using the BETA branch for looking at the source code I make no commitment that the BETA code has been backmerged to the trunk - certainly if you want to examine/modifyt he C code you *MUST* use the beta branch or you'll just not get very far.
http://livebox-hah.googlecode.com/svn/branches/xap-lua-engine/
Hello Steve
Yes - Ive added a 16*2 backlight display my R&D rig as well - I have to say it does look very cool.
(Tweaked Bascom line 164 to read "Config Lcd = 16 * 2 ")
I'll be interested to hear how you go with this.
I was good for a day or two, then the URF stopped working. All other functions on the AVR seemed good. At this point I killed off xap-livebox and used microcom to drive the AVR interactively. There was an error reported in parsing the URF string.
We did subsequently tweak some of the Bascom stack settings. However, I've had no time to test this again.
Derek.
Added some photos of the new 16*2 LCD display added to a livebox.
http://harry-projects.blogspot.com/2011/04/adding-arduino-to-hah-livebox.html
Harry
Hi Steve,
Do you need the Ardunio bootloader on the 328 before you upload the HEX file? I was going to buy a couple but then noticed that some had an Arduino bootloader and some didn't. I will probably use AVRDUDE to program the 328 with Arduino Duemilanove board, unless one of the programs mentioned above can also br used with the Arduino board.
Thanks for any advice,
Karl
The bootloader isn't necessary. You can flash the HEX straight to the chip if you have an AVR ISP. If you only have an Arduino to hand then you are going to need the 328's to have bootloaders so you can use AVRDUDE to flash the HEX.
Or if you have 2x Arduinos you can program one up as an ISP and use to install bootloaders on your other Arduino. Having said that I tried this an never got it working property so I ended up using a real AVR ISP unit to install my bootloaders.
The programs mentioned above assume there is an bootloader installed without it they won't work.
Brett
I've got hold of a couple of ATMEGA328P-PU's, but haven't been successful in programming with the latest AVR HEX file version 2.3. The output from AVRDUDE is below and everything seemed to go ok, but when I put it in the HAH PCB the web interface reports Build: 279.19/1.0 and I can't control the relays from the WebGUI. I've uploaded an Arduino sketch back to the 328, so I'm sure it's OK in itself.
I've also tried the microcom -s 115200 /dev/ttyS0 after killing xap-livebox, but there was no output.
Am I using the wrong ATMEGA328 chip or is the problem elsewhere, any ideas?
Thanks
Karl
C:\Users\Downloads\ArduinoUploader>avrdude -F -v -pm328p -cstk500v1 -P\\.\C
OM5 -b57600 -D -Uflash:w:"C:\Users\Downloads\livebox-urf.hex":i
avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
System wide configuration file is "C:\Users\Downloads\ArduinoUploa
der\avrdude.conf"
Using Port : \\.\COM5
Using Programmer : stk500v1
Overriding Baud Rate : 57600
AVR Part : ATMEGA328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Max
W ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
eeprom 65 5 4 0 no 1024 4 0 3600 36
00 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 45
00 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 45
00 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0
0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.03s
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "C:\Users\Downloads\livebox-urf.hex"
avrdude: writing flash (12204 bytes):
Writing | ################################################## | 100% 6.12s
avrdude: 12204 bytes of flash written
avrdude: verifying flash memory against C:\Users\Downloads\livebox-urf.hex:
avrdude: load data flash data from input file C:\Users\Downloads\livebox-ur
f.hex:
avrdude: input file C:\Users\Downloads\livebox-urf.hex contains 12204 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 5.22s
avrdude: verifying ...
avrdude: 12204 bytes of flash verified
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK
avrdude done. Thank you.
C:\Users\Downloads\ArduinoUploader>
The 328P is the correct part. I've never used avrdude, but note that if you bought a 'virigin' chip, it defaults to using its internal 1MHz clock and the 'divide clock by 8' fusebt will be set. If you bought a pre-prepared Arduino chip, it should have these settings already altered, but you might want to try changing the reset vector to avoid the Arduino bootloader being invoked.
Cheers,
Derek.
Thanks Derek, that helps. This is what I've bought, http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=320693024204&ssPage..., and it comes with a 16MHz XTAL. But I think it could be the reset vector you mention, because if I put the chip back in the Arduino I can send a sketch to it, meaning the Arduino bootloader is being executed I guess.
So I think my next step will be to change the reset vector and work out what the fusebt should be set to.
Thanks
Karl
Hi Steve,
Good to hear that you are making progress with the HAH. I also recall a great afternoon with a few beers ... it was sometime around 1980 ;-)
If you google for 'google code hah' you will find, as the first hit, the link to all of the source for the HAH project. Drill down to source/browse/trunk/userapps/hah/xap-livebox ... the BASCOM source code is there.
Many folks are waiting for the 'Universal RF' chip release. It is very close ... but still not quite ready for general release. If you need a specific capability ... the correct part can be had from the shop.
Cheers,
Derek.