http://datasheet.datasheetarchive.com/originals/distributors/Datasheets-25/DSA-492462.pdf
]]>6by9 says from the raspberry pi fourm…
“There was a change between iirc the 4.4 and 4.9 kernels to use the upstream bcm2835-i2c driver instead of the older bcm2708-i2c one. Even Jessie had gone to kernel 4.9 though, which would imply that you hadn’t updated the Jessie install for ages. “lsmod” will confirm which driver modules are loaded.”
From what I gathered is that spi_bcm2835 has been replaced with bcm2708. I ran into a similar issue while configuring i2c.
here’s another good link on information about that.
]]>int bcdToDec(int b) {
int result=0;
result += (0x70 & b)*10; // MSB *10
result += (0x0F & b); // LSB
return result;
}
and in the main code change
char buf[BUFFER_SIZE];
to
int buf[BUFFER_SIZE];
Any explanation??
]]>And I cannot find spi-bcm2708 in /lib/modules/* Is this an error in the book or a change caused by an upgrade to the system??
Anthony
regards,
Vikrant
Add your bcdToDec function above int main():
int bcdToDec(int b) { return (b / 16) * 10 + (b % 16); }
Change the main code to:
int secs = bcdToDec(wiringPiI2CReadReg8(fd, 0x00));
int mins = bcdToDec(wiringPiI2CReadReg8(fd, 0x01));
int hours = bcdToDec(wiringPiI2CReadReg8(fd, 0x02));
I have read chapter 7 and I’ve watched the video and I am able to cross compile on my Linux VM and deploy and run them on the RPi. The reason I can do this is because your book and your video are superb. I have never found such a easy to understand lesson on a difficult subject like cross compilation. I’ve unsuccessfully struggled with it for years until I found your book and video. THANK YOU!
I am now ready to try to use the WiringPi library to build an app using I2C. I’ve installed and built WiringPi using my Linux VM. I’ve got the paths setup properly in Eclipse. I can build my app. But it won’t link. When I link Eclipse complains my libwiringPi.so file has the wrong file format. I know why this is. It is because I built it using my amd64 toolchain not the armhf toolchain. Can anyone tell me how to build with the armhf toolchain?
I know I can build the library on my RPi and copy it to the Linux VM, but I don’t want to do that. I’d like not have to do development things on the Rpi. I’d prefer to build my library on my Linux machine. Is this possible?
Lastly I’d also like to be able to deploy my app, and all required libraries to a new RPi installation. Is this possible with Eclipse? Will it install my binary as well as needed libraries? If not I might as well get used to having to install WiringPi on every RPi I want to use it on and copy it to the Eclipse machine.
Thanks again for such a great book and video. After I play around with the RPi I plan to purchase a BeagleBone Blue and develop on it. Will you be making a book for the BB Blue?
]]>pi@raspberrypi:~/bin $ cat /boot/cmdline.txt
#dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
2. Disable serial-getty@ttyAMA0. However it’s not enough to use systemctl disable… as explained in http://stackoverflow.com/questions/21596384/cannot-disable-systemd-serial-getty-service
For rpi3, it seems that renaming of device names is causing problems. ttyAMA0 is used for bluetooth. Serial device is instead attached to ttyS0, see eLinux again, http://elinux.org/RPi_Serial_Connection. Search for cmdline.txt.
]]>