Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 2.09 KB

README.md

File metadata and controls

46 lines (37 loc) · 2.09 KB

※Access GPIO of HT66F318 (via slave address 0x27) applications

  • Using the host I2C access MCU internal resource GPIO, EEPROM(64bytes), ADC(8ch 12bits), PWM output(10bit), Capture, OLED display...
    專案利用PC or Raspberry Pi or Arduino 軟件主控通過I2C下達通訊指令以存取GPIO port, EEPROM(64bytes), ADC(8ch 12bits), PWM output(10bit), Capture, OLED display...

  • 在MCU資源不足或是應用裝置缺乏時, Host即可透過I2C來控制這個裝置而把UART port use for other

  • Project Option:
    HIRC12M (hi speed internal RC): 可選項有:HXT(400K~16Mhz),HIRC4M,HIRC8M,HIRC12M
    LICR (Low speed internal RC for TB0/TB1): 可選項有:LXT(32.768Khz),LIRC(32Khz)
    So no need any external OSC. or X'tal in this project.
    WatchDog: enable

  • TB0,1 enable LIRC interrupt for 16.05ms, 0.514sec

  • TM0 enable HIRC12M (hi speed internal RC) interrupt for around 200us

  • I2C slave(address 0x27) SDA(PC5),SCL(PC6) Host(PC or Raspberry Pi)速度必須在100K/bps以下, 連續的read/write更可能要在50K/bps(HIRC8M)
    HT66F318 Internal RC HIRC8M/HIRC12M 兩種HIRC也有差別的

I2C slave 收到host write資料後, 暫放置於準備傳輸的緩衝當中, 準備被I2C提取(host read)
一次性長度(Read or Write), 最長為8bytes

Relevant information

  • HT-IDE3000 V8.02 Image
  • HOLTEK C Compiler V3/Assembly Image
  • HT66F318 Config, used 8Mhz X'tal external, VDD/VDDA binding Image Image Image Image
  • HT66F318 28ssop Schematic Diagram Image Image

How to test or used

Using PC or Raspberry Pi or Arduino Host software control I2C of MCU (Slave address 0x27)

  • I2C slave read: @27 Port0 Port1
  • I2C slave write: @27 Port0 Port1