Quote Originally Posted by savnik View Post
I have the bh1415f datasheet and i have read , but i don't know how to send the data to bh1415f , because this chip has data,clock and enable
For the TSA551 i don't have problem.I have use it many times , but this have only data and clock and use I2CWRITE SDA,SCL,ADDR1,[HI,LO,$8E] to send the data
Code:
freq var word
dataout var word
hardcode var word
chipselect var portb.0 'or whatever pin you've got set for the chip select
datapin var portb.1 'or whatever pin you've got set for the data pin
clockpin var portb.2 'or whatever pin you've got set for the clock pin

hardcode = %0100100000000000 'hardcoded values - not in test mode, phase detector normal, stereo operation, doesn't (shouldn't?) change

freq = 1021   'frequency desired = 102.1 Mhz
dataout = hardcode + freq 'add in frequency value
high chipselect
shiftout datapin , clockpin , 0 , [ dataout/16 ]
low chipselect