![]() nd("- I2C Demo -") // welcome text line 1 Wire.beginTransmission(device_id) // define device nr to transmit to put random characters on random places on the display Use the '10' special command to position a character on the display. '65' is 'A').Įnable Character Positioning (must be followed by row and column, see below) Use ASCII values to send individual characters to the display (e.g. To send data to the I2C LCD board you will need to use I2C and address it to the device's I2C id. (arduino's do have pull up resistors on the I2C bus) You will have to add these to your project. The board does not provide I2C bus pull-up resistors.As per the I2C protocol the device supports giving an acknowledge by holding down SDA line.This can be set in the code and is currently set to 5 seconds. The display board will assume end of transmission after a timeout.Use the following fuse bytes to set the clock:Īvrdude -c %PGM_PROTO% -P %PORT% -p %PGM_DEVICE% -U flash:w:%PROJECT%.hex -U lfuse:w:0圎2:m Howerver, to speed up communications it would be worthwile to set the clock speed of the ATtiny as high as possible. The ATtiny can keep up with this speed due to clock stretching. The software was developed using an Arduino as I2C master running at 16MHz.change the source code to remove the line that was added in step 1ĥ. power up the board and enter the setup mode to confirm that the ID has been setĤ. compile the code and write to the chip using the ISP header (or use an external programmer)ģ. change the source code and add a line that will write a value (e.g. If this is a bug it can be remedied fairly easily by following these steps:ġ. Whether this affects further operation of the board is unknown as I don't have any brand new chips to test with. The v1.0 firmware currently does not detect an out of range value and may cause the read-eeprom-value to fail. This could mean '0x00' or '0xFF' or maybe even something else. I need to test this further but my concern is this: brand new microcontrollers have their EEPROM empty. (bug?) There may be a bug with this firmware that can cause the display not to work properly.The screen is cleared and it will sit there until there's something to display. When powered on it will show a brief message 'I2C LCD Module' and on the second row 'Listening.'. When assembly has been completed and the ATtiny84 has been flashed with the proper firmware the board is ready to use.The serial shift register chip I use is the M74HC595B1 from ST.This basically means that the board will try to go into setup mode but never gets further because the button is not released properly. It made a connection between the top two pins even when the button was not pressed. It turned out that I didn't install the push button properly. I had a case where I assembled the board and all I could see was a dark top half of the screen and nothing seemed to work. When assembling the board I would recommend not to install the push button until you have confirmed that the display is showing activity.Press and hold the button for about 5 seconds to store the new ID into eeprom. Pressing the button will cycle through these values. The I2C protocol will be able to address a maximum of 127 devices on the bus. The display should show the current I2C id. After 5 seconds, release the button and the board will go into setup mode. With the button pressed the display will show black characters on the top row of the display. ![]() To use this, hold down the push button and then apply a voltage source to power up the board. The pushbutton sets the internal I2C id.Check the PROG.BAT or prog file for the proper settings. So be sure to set the lower fuse byte to 0圎2 to disable CLKDIV8 and to make the chip run on 8MHz. The code for this chip should be running on 8MHz in order with other I2C devices, but it may run on lower frequencies as well. V0.03 File:0051-firmware v0.03.zip Released: 1 April 2013īe aware that I2C does not need a specific operating frquency. Other boards I'm currently designing: Pending_PCB_manufacturing Softwareĭiptrace files (schematic and PCB): File:0051-I2C-LCD-board-v1.0.zip
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |