From 4772b911900cd53acf401433ae02f079aeed81ab Mon Sep 17 00:00:00 2001 From: ceb Date: Sun, 23 Jan 2005 23:50:48 +0000 Subject: [PATCH] start if i2c program added PIC ID info into README.protocol --- cebpic/README.protocol | 13 +++++++++++++ cebpic/i2c-test.asm | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/cebpic/README.protocol b/cebpic/README.protocol index f97fa8a..5b5582c 100644 --- a/cebpic/README.protocol +++ b/cebpic/README.protocol @@ -1,3 +1,6 @@ +NMRA +==== + NMRA packets from the computer to the PIC should consist of 8-bit bytes. bits 6-0 contain the data to be sent to the track @@ -13,3 +16,13 @@ Messages longer than this will cause things to get confused at the moment. baud rate 9600 most significant bit first 8n1 + + +Flash memory +============ + +Byte 20 0000h bit 0 is 1 for the main PIC and 0 otherwise + + +I2C +=== diff --git a/cebpic/i2c-test.asm b/cebpic/i2c-test.asm index 901e6cb..baffa73 100644 --- a/cebpic/i2c-test.asm +++ b/cebpic/i2c-test.asm @@ -106,6 +106,26 @@ initialise bcf IPR1,5,0 ; set to low-priority interrupt +;---------------------------------------------------------------------------- + +; i2c setup + +; p68 +; p314 +; p 275 ID locs + +; test whether master PIC (location 20 0000h bit 0; 1 if true) +; by doing: +; set tblptr (tblptru/tblptrh/tblptrl) +; tblrd * +; result in tablat + +; i2c_master_setup if so, i2c_slave_setup if not + + + + + ;---------------------------------------------------------------------------- ; interrupt set-up -- 2.30.2