Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Shiftout clocks EDGE???

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Unsupported versions
View previous topic :: View next topic  
Author Message
jeezywonder

Bascom Member



Joined: 19 Jan 2017
Posts: 34
Location: Russia, Vladivostok

russia.gif
PostPosted: Fri May 05, 2017 12:41 pm    Post subject: Shiftout clocks EDGE??? Reply with quote

Hi,
Im in the situation now where clock generated by SLAVE(eeprom) and for example for data shiftin - it is impossible to read by slave's clocks, like this:


Code:
$regfile = "m8def.dat"
$crystal = 7600000
$hwstack = 64
$swstack = 64
$framesize = 64
$baud = 9600
D2 Alias Portd.2                                            'msda output
Dim Start_byte As Byte
Dim Data_read As Byte
Datain2 Alias Pind.3                                        'msda input
Datain4 Alias Pind.4                                        'clock input
Config Pind.4 = Input
Config Pind.3 = Input
Config Portd.2 = Output
D2 = 1                                                      ' make msda = 0 (cuz of resistors output msda is inversve, 0 is 1, 1 is 0)
Waitms 5                                                    ' wait 5ms, so clock will do its inizialisation bits
D2 = 0                                                      ' put msda high
Waitus 20
Bitwait Datain4 , Reset
Waitus 5
D2 = 1
Bitwait Datain4 , Set
Waitus 1
D2 = 0
Shiftin Datain2 , Datain4 , Data_read , 7 , 8 , 40
If Data_read = &H55 Then
 Print Hex(data_read)
Else
  Print "BOOT FAIL"
End If
 


But the problem comes with shiftout, it just doesn't have option 7, simply say shiftout cmd can't use xtl clock, why is that?
And how i can shiftout bytes another way?
Also, i can't use i2cSlave.lib, because im using simplified i2c.
Any help appriciate it, thanks


(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
jeezywonder

Bascom Member



Joined: 19 Jan 2017
Posts: 34
Location: Russia, Vladivostok

russia.gif
PostPosted: Sat May 06, 2017 3:43 pm    Post subject: Reply with quote

Noone?
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat May 06, 2017 5:59 pm    Post subject: More info Reply with quote

Perhaps you have to give some more information. Gone over your question but don't know what the problem is. You are talking about Slave(eeprom), is this hardware and what kind of hardware?

Not using the i2cSlave.lib, but you are using simplfied i2c. What is that?

Ben Zijlstra
Back to top
View user's profile Visit poster's website
jeezywonder

Bascom Member



Joined: 19 Jan 2017
Posts: 34
Location: Russia, Vladivostok

russia.gif
PostPosted: Sun May 07, 2017 7:42 am    Post subject: Re: More info Reply with quote

bzijlstra wrote:
Perhaps you have to give some more information. Gone over your question but don't know what the problem is. You are talking about Slave(eeprom), is this hardware and what kind of hardware?

Not using the i2cSlave.lib, but you are using simplfied i2c. What is that?

Ben Zijlstra

Hi,
I'm using Atmega8 with PCF7945 IC's eeprom, so in PCF7xxx family clock generates by pcf, therefore i can not use any of shiftout options[0-3], becouse it can work only with Atmega8(master) clocks. Simplified i2c means PCF more like i2c, spi - use their own dialogue, other then standart i2c protocol. And im not comletly sure about i2cSlave.lib because im lack of info about it, help page is not providing to much of it... thanks
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Unsupported versions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum