Click here to Skip to main content
15,891,749 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Do you remember that time? Pin
Vivi Chellappa18-Dec-21 13:48
professionalVivi Chellappa18-Dec-21 13:48 
GeneralRe: Do you remember that time? Pin
Slow Eddie19-Dec-21 7:34
professionalSlow Eddie19-Dec-21 7:34 
QuestionWould you release this or not? Pin
honey the codewitch18-Dec-21 0:59
mvahoney the codewitch18-Dec-21 0:59 
AnswerRe: Would you release this or not? Pin
0x01AA18-Dec-21 1:17
mve0x01AA18-Dec-21 1:17 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 1:21
mvahoney the codewitch18-Dec-21 1:21 
GeneralRe: Would you release this or not? Pin
0x01AA18-Dec-21 1:31
mve0x01AA18-Dec-21 1:31 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 2:38
mvahoney the codewitch18-Dec-21 2:38 
AnswerRe: Would you release this or not? Pin
Mike Hankey18-Dec-21 1:33
mveMike Hankey18-Dec-21 1:33 
I would take the case were it works with the old and not the optimized and put a scope or analyzer on it and see what the difference is.

In my SPI lib code I had to add nop's to give time for transition, could be as simple as that?

uint8_t CSpiBB::TransferData(uint8_t data)
{
	volatile uint8_t result = 0;
	
	volatile uint8_t	start = 7;
	volatile int8_t		step = -1;

	if (_dir == LSB)
	{
		start = 0;
		step = 1; 
	}

	for (volatile uint8_t i = start, cnt = 0; cnt < 8; cnt++, i = i + step)
	{
		//Set the MOSI bit appropriately
		if (data & (1 << i))
			*_port |= (1 <<_mosi);
		else
			*_port &= ~(1 << _mosi);
		
		//Low to high transition to allow data to be transferred to/from device.
		*_port |= (1 << _clk);
		asm volatile ("nop");
		
		//Grab the data that has been shifted in.
		if (*_pin & (1 << _miso))
			result |= (1 << i);
		else
			result &= ~(1 << i);
		
		//High to low transition to complete clocking
		*_port &= ~(1 << _clk);
		asm volatile ("nop");
	}

	return result;
}

The less you need, the more you have.

Even a blind squirrel gets a nut...occasionally.

JaxCoder.com

GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 2:36
mvahoney the codewitch18-Dec-21 2:36 
AnswerRe: Would you release this or not? Pin
Jo_vb.net18-Dec-21 2:23
mvaJo_vb.net18-Dec-21 2:23 
GeneralRe: Would you release this or not? Pin
bmarstella20-Dec-21 1:01
bmarstella20-Dec-21 1:01 
AnswerRe: Would you release this or not? PinPopular
Randor 18-Dec-21 1:44
professional Randor 18-Dec-21 1:44 
AnswerRe: Would you release this or not? Pin
theoldfool18-Dec-21 2:28
professionaltheoldfool18-Dec-21 2:28 
AnswerRe: Would you release this or not? Pin
dandy7218-Dec-21 4:44
dandy7218-Dec-21 4:44 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 5:15
mvahoney the codewitch18-Dec-21 5:15 
AnswerRe: Would you release this or not? Pin
kmoorevs18-Dec-21 6:03
kmoorevs18-Dec-21 6:03 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 6:04
mvahoney the codewitch18-Dec-21 6:04 
AnswerRe: Would you release this or not? Pin
Gerry Schmitz18-Dec-21 6:30
mveGerry Schmitz18-Dec-21 6:30 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 6:31
mvahoney the codewitch18-Dec-21 6:31 
GeneralRe: Would you release this or not? Pin
Gerry Schmitz18-Dec-21 6:44
mveGerry Schmitz18-Dec-21 6:44 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 7:18
mvahoney the codewitch18-Dec-21 7:18 
AnswerRe: Would you release this or not? Pin
Luc Pattyn18-Dec-21 11:38
sitebuilderLuc Pattyn18-Dec-21 11:38 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 11:40
mvahoney the codewitch18-Dec-21 11:40 
GeneralRe: Would you release this or not? Pin
Luc Pattyn18-Dec-21 11:47
sitebuilderLuc Pattyn18-Dec-21 11:47 
GeneralRe: Would you release this or not? Pin
honey the codewitch18-Dec-21 11:48
mvahoney the codewitch18-Dec-21 11:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.